i need to plot the EEG in matlab.. i have downloaded the data base which is in .txt format. bt i am unable to plot it.. plz help
2 ビュー (過去 30 日間)
古いコメントを表示
x=load('F001.txt');
y=fft(x)
PS=abs(y).^2;
N=length(x);
fs=1000;
freq=(1:N/2)*fs/N;
plot(freq,PS)
this is not working,... an error is reported
Error using plot Vectors must be the same lengths.
Error in PLOT (line 7) plot(freq,PS)
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 11 月 2 日
Look at freq=(1:N/2)*fs/N ,its length is different from PS length
5 件のコメント
Azzi Abdelmalek
2013 年 11 月 2 日
編集済み: Azzi Abdelmalek
2013 年 11 月 2 日
x=load('F001.txt');
y=fft(x)
PS=abs(y).^2;
N=length(x);
fs=1000;
freq=(0:N-1)*fs/N;
plot(freq,PS)
If you want a symetric plot for frequencies: [-freq,freq]
freq=(0:ceil(N/2)-1)*fs/N;
PS=PS(1:numel(freq));
plot([-freq freq],[fliplr(PS) PS])
その他の回答 (0 件)
参考
カテゴリ
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!