Generate simulated EEG signals

bst_call(@export_matlab, {char(sStudy.Data(1,index).FileName)},'data');

I generated a simulated signal in Brainstorm and planned to write code to generate simulated EEG signals based on this signal. However, during execution, I received an "index out of bounds at position 1" error. Upon checking, I found that there was no data in data, and I'm not quite sure why there is no data in data.

Hi @SAN, could you provide more details on which processes are you using to simulate the signals, and how these signals are going to be used to simulate EEG?

From your screenshot, it seems you simulated arbitrary signals, thus they are a matrx (that should be the file in the Matrix field of your study). The field Data is for recordings (EEG, MEG, etc.) which besides the time series, they have also an associated a channel, defined in the channel file.

Thank you for your reply. I first used the "simulate generic signals" function in the pipeline editor to create a sine wave signal, then used the following function to generate simulated EEG signals based on this simulated sine wave signal.Then the error message mentioned above appeared.

image
data_generator.m (3.8 KB)
Simulation_Data_Generate.m (8.3 KB)