Hello BST team,
I know that asking for help with scripting is a bit outside the scope of this forum but I am stuck and ran out of ideas for troubleshooting so I am just trying my luck to see if anyone has any thoughts on this.
I am trying to run the following script for PSD analysis but when it gets to the second loop for the second ".mat" file I get the error message below that the line isFile = sFiles{i}; brace indexing is not supported. This was completely unexpected for me and I do not understand why this is the case. I've tried (), {}, and and none of them seem to solve the problem. What can I do to fix this?
sFiles = {...
'Test_PSD/@raw5AD13_s3_sleep_epochs/data_0raw_5AD13_s3_sleep_epochs.mat'...
'Test_PSD/@raw5AD13_s5_sleep_epochs/data_0raw_5AD13_s5_sleep_epochs.mat'};
for i = 1 : length(sFiles)
isFile = sFiles{i};
Start = 0 : 4 : floor(in_bst(sFiles{i}).Time(end));
End = 4 : 4 : round(in_bst(sFiles{i}).Time(end));
for j = 1 : length(End)
One = Start(j);
Two = End(j);
% Process: Power spectrum density (Welch)
sFiles = bst_process('CallProcess', 'process_psd', isFile, [], ...
'timewindow', [One, Two], ...
'win_length', 4, ...
'win_overlap', 0, ...
'units', 'physical', ... % Physical: U2/Hz
'sensortypes', 'MEG, EEG', ...
'win_std', 0, ...
'edit', struct(...
'Comment', 'Power,FreqBands', ...
'TimeBands', [], ...
'Freqs', {{'delta', '0.1, 4', 'mean'; 'theta', '5, 7', 'mean'; 'alpha', '8, 12', 'mean'; ...
'sigma_avg', '11, 16', 'mean'; 'sigma_max', '11, 16', 'max'; 'beta', '13, 29', 'mean'; ...
'gamma1', '30, 59', 'mean'; 'gamma2', '60, 90', 'mean'; 'BG_EEG1', '4, 10', 'mean'; 'BG_EEG2', '20, 30', 'mean'}}, ...
'ClusterFuncTime', 'none', ...
'Measure', 'power', ...
'Output', 'all', ...
'SaveKernel', 0));
end
end