How to bring in a single channel EEG signal from MATLAB workspace into Simulink?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Shivani
le 13 Mai 2024
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 commentaire
Walter Roberson
le 13 Mai 2024
t = (0:length(YOUR_EEG_SIGNAL)-1) / fs .';
SIGNAL = [t, YOUR_EEG_SIGNAL(:)];
assignin('base', 'SIGNAL', SIGNAL);
Now From Workspace asking for SIGNAL
1 commentaire
Voir également
Catégories
En savoir plus sur EEG/MEG/ECoG dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!