vec_A、vec_B、vec_cはランダムなデータを持つ行列です。タイマー-6」タイマーのTimerFcnを評価しながら5分ごとのテキストファイルにデータを書き込むMatlab
エラー:私はすべての5分間のテキストファイルにデータを書き込みたい、私のコードは次のように:
function samplegui_OpeningFcn(hObject, ~, handles, varargin) handles.timer = timer(... 'ExecutionMode', 'fixedRate', ... % Run timer repeatedly 'Period', 300, ... % Initial period. 'TimerFcn', {@open,hObject}); % Specify callback handles.output = hObject; handles.vec_A=[]; handles.vec_B=[]; handles.vec_C=[]; guidata(hObject, handles); function open_Callback(hObject, eventdata, handles) % push button to receive serial data. cnt=0; while 1 % Getting data from Serial Port get_lines=fgets(handles.se) % getting data from serial port if~isempty(get_lines) cnt=cnt+1; if strfind(get_lines,'T') %Parsing data handles.vec_A=[handles.vec_A;[timet newword]]; plot(handles.vec_A(:,1),handles.vec_A(:,2:end),'r'); % plotting % Same follows for parsing and plot vec_B and Vec_C drawnow(); % to update the Plots end end Pause(.05); start(handles.timer); % saving the data dlmwrite('My_sample1.txt',handles.vec_A); dlmwrite('My_sample2.txt',handles.vec_B); dlmwrite('My_sample3.txt',handles.vec_C); stop(handles.timer); end guidata(hObject, handles);
私のコードを実行している間に、次のエラーが発生します'
入力引数が多すぎます。
この場合、タイマーを実行して5分ごとにデータを正常に書き込む方法や、それ以外の方法を提案する方法。
質問は何ですか?または、あなたのコードの問題は何ですか? – Lati
@Lati編集した投稿を見てください。 – MaK