12345678910111213141516 |
- function [final_design] = JA_TMS_random_delays(final_design, TMS_delay, ifi)
- % based on the TMS delay it sets the TMS timings according to the '0.0' or
- % '-0.05' categories
- TMS_delay = str2double(TMS_delay{1});
- jitter = 0.05;
- TMS_tmp = [TMS_delay-jitter:ifi:TMS_delay:ifi:TMS_delay+jitter+ifi];
- TMS_delay_array = repmat(TMS_tmp, [1, ceil(size(final_design,1)/length(TMS_tmp))]);
- idx_TMS_full = randperm(length(TMS_delay_array));
- idx_TMS_def = idx_TMS_full(1:size(final_design,1));
- final_design.TMS = TMS_delay_array(idx_TMS_def)';
- end
|