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!