I need to loop a code i was given
7 次查看(过去 30 天)
显示 更早的评论
I was given a code that was tested on a single participants data to see if it would do what we were intending it to do (defining baseline timeframe), now I need to loop the code to be able to run all of my participants. This is the current code with the participant number included.
raw(20).draw %see this one
stim = nirs.design.StimulusEvents;
stim.name = 'Temp';
stim.onset = [35 raw(20).time(end)-35];
stim.dur = [1 1];
stim.amp = [1 1];
raw(20).stimulus('Temp') = stim;
figure; raw(20).draw %You can see the stim events
job = nirs.modules.TrimBaseline();
job.preBaseline = 10;
job.postBaseline = 10;
raw(20) = job.run(raw(20));
figure; raw(20).draw %see after remove the spikes
job = nirs.modules.KeepStims();
job.listOfStims = '';
raw(20) = job.run(raw(20))
figure; raw(20).draw
This is the error i get when i remove the participant idendifier (20) or try to replace it with (1:24)
Expected one output from a curly brace or dot indexing expression, but there were 24
results.
essentially i need to define the loop for this code that i have.
Thanks so much for helping out.
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!