How to bring in a single channel EEG signal from MATLAB workspace into Simulink?
4 ビュー (過去 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!
1 件のコメント
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
1 件のコメント
参考
カテゴリ
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!