How to bring in a single channel EEG signal from MATLAB workspace into Simulink?
2 次查看(过去 30 天)
显示 更早的评论
I've been trying to bring an EEG signal into simulink that is made up of a single column, but it says I cannot use neither signal from workspace nor From work space block due to it not having a second channel (time related). Is there any other way to import the signal? I've tried inputting it as {t,data] but it still doesn't work. My time was as follows:
t=0:1/256:40 %256 is the fs, and 40 is the signal duration in seconds
The data is a single channel eeg data, it is a column with 10240 values (256Hz * 40secs).
0 个评论
回答(2 个)
Shivani
2024-5-13
Hi Tania,
After generating the value in variable “t” at my end, it is my understanding that it is a matrix of dimension 1*1024. This means that there are 1024 columns and 1 row in the matrix. Since your question mentions that the dataset contains only a single column, it is likely that a mismatch in the expected number of rows and columns may be leading to the error encountered.
You can import this data into your Simulink model by utilising the “Simin” block which can be found in “Simulink/Sources”. You can refer to the following MathWorks Documentation link for more details regarding this: https://www.mathworks.com/help/simulink/slref/fromworkspace.html
Additionally, you can also refer to this documentation for more information on loading data from the workspace: https://www.mathworks.com/help/simulink/ug/load-data-using-the-from-workspace-block.html
I hope this helps!
Walter Roberson
2024-5-13
t = (0:length(YOUR_EEG_SIGNAL)-1) / fs .';
SIGNAL = [t, YOUR_EEG_SIGNAL(:)];
assignin('base', 'SIGNAL', SIGNAL);
Now From Workspace asking for SIGNAL
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!