How can I generate EEG signal block from workspace to simulink? I attach the (.txt) file and code also.

14 ビュー (過去 30 日間)
shohan nur
shohan nur 2018 年 8 月 1 日
回答済み: shohan nur 2018 年 8 月 18 日
clc;
clear;
clear all;
%%start by generating an eeg signal (EEG 2D data)
fs = 512;
T = 1/fs;
EEGsig= load ('EEGdata_01_Double.txt');
ls = size(EEGsig); N = length(EEGsig);
t = [0:N-1]/fs;
fx = fs*(0:N-2)/N;
x=EEGsig;
figure();
grid on;
hold on;
plot(EEGsig);
ylabel('Amplitude (microvolt)');
xlabel('Time (s)');
title('EEG Signal');

回答 (3 件)

Fangjun Jiang
Fangjun Jiang 2018 年 8 月 1 日
With your above data calculated in work space, grab a "From Workspace" block, specify the data as [t' EEGsig], you will get two channels of signals from t=0 to t=2.5

Sara Nadeau
Sara Nadeau 2018 年 8 月 1 日
Here's the reference page for the From Workspace block to help get you started.
If it's more convenient to set your Simulink model up to load from a file, so you don't always have to run the code in your post, you can also save the EEG signal data as an array or timeseries in a MAT-file and load the data into your model using the From File block.
Hope this helps!

shohan nur
shohan nur 2018 年 8 月 18 日
sorry! for late thanks. But I can't create a block in Simulink to generate an EEG signal then what should I do?

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by