How can i plot a multiple EEG signal channels ?

68 ビュー (過去 30 日間)
Nguyen Ngoc Nghiem
Nguyen Ngoc Nghiem 2024 年 2 月 27 日
コメント済み: DGM 2024 年 3 月 5 日
hello sirs, how can we plot a picture has multiple EEG signal channels like the picture above. My data have sampling frequency fs= 500, recordDuration= 1s, 21 channels and 21 record numbers. Can you give me an example code ? Thanks !

採用された回答

Voss
Voss 2024 年 2 月 27 日
編集済み: Voss 2024 年 2 月 27 日
Example:
fs = 500;
tmax = 1;
nch = 21;
nt = fs*tmax;
t = (0:nt-1)/fs;
data = randn(nt,nch);
figure('Position',[1 1 500 800])
h = stackedplot(t,data,'k','DisplayLabels',"EEG"+(1:nch));
set(h.AxesProperties,'YLimits',[-3 3])
  3 件のコメント
Voss
Voss 2024 年 2 月 27 日
You're welcome! Any questions, let me know.
If this answer helped you, consider voting for it and/or "Accept"ing it. Thanks!
DGM
DGM 2024 年 3 月 5 日
Posted as comment-as-flag by Nguyen Ngoc Nghiem:
this answer was a great help for this problem

サインインしてコメントする。

その他の回答 (1 件)

Adrián László Szemenyei
Adrián László Szemenyei 2024 年 2 月 27 日
編集済み: Adrián László Szemenyei 2024 年 2 月 27 日
If you dont want to implement it, just use EEGLAB (which can read in numerous different data types, if I remember correctly, you can also use it to change your data type to .mat).
If you want to implement it with the slider and whatnot, check out MATLAB GUI and its functions (you will probably need uifigure, uipanel, uiaxes, uislider).
To change the names on the y-axis, use yticks and yticklabels function. (Note that if your data is really large and you read it all in, the GUI might be slow and/or crash, EDIT: but this is not the case for you)
Alternatively stackedplot, you can use subtightplot. Or if you dont mind if two channels possibly overlap, than add different values to the different channels.
EDIT: I realized that your data is only one second long, so you probably dont need GUI with its slider, but the rest of my answer is relevant.
  3 件のコメント
Nguyen Ngoc Nghiem
Nguyen Ngoc Nghiem 2024 年 2 月 27 日
Thanks, sir. I encountered a lot of difficulties when dealing with 3D datasets with .edf files. :((
DGM
DGM 2024 年 3 月 5 日
Posted as comment-as-flag by Nguyen Ngoc Nghiem:
this answer was a great help for this problem

サインインしてコメントする。

カテゴリ

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

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by