私は MATLAB を初めて使用し、別の m ファイルで反復できる構造を構築する際に問題があります。各試行でセグメントを使用して試行をi
行った被験者がいます。各セグメントから特定のタイムポイントを保存したいと思います。ここではand と呼びます。私は次のことを試しました(1つの被験者、1つの試行に対して):t
w
startTime
stopTime
i=1; %Testperson #
% Trial 1
t=1; %Trial #
w=1; %Segment 1
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'startTime',0.001*5000)
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'stopTime',24.5*5000)
w=2; %Segment 2
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'startTime',0.001*5000);
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'stopTime',24.5*5000);
w=3; %Segment 3
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'startTime',0.001*5000);
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'stopTime',24.5*5000);
w=4; %Segment 4
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'startTime',0.001*5000);
selectedData = setfield('selectedData',['Subj' num2str(i)],['Trial' num2str(t)],{w},'stopTime',24.5*5000);
setfield
保存したい以前の値を上書きしているようですか?助言がありますか?