필터 지우기
필터 지우기

Error using pwelch - Expected x to be finite.

조회 수: 47 (최근 30일)
Felicia DE CAPUA
Felicia DE CAPUA 2022년 10월 24일
댓글: Felicia DE CAPUA 2022년 10월 25일
Hi everyone,
x=load('\\fs01.hpc.unipr.it\bonini01\WIRELESS_Wifi_Router_Impianti2021\Acquisizioni Deuteron\ProvaHyper_20220915_M1\LFP1.mat');
input=x.LFP1;
y=fft(x.LFP1);
M1_LFP1=rmmissing(input);
N=64;
window=hamming(N);
noverlap=N/2;
nfft=length(M1_LFP1);
new_fs=542.4;
time_1=(1:length(M1_LFP1))/new_fs;
[s,f,t]=spectrogram(M1_LFP1,window,noverlap,nfft,new_fs);
colormap('jet');
This is my code to compute the spectrogram but when I'm running it appears this error:
Error using pwelch - Expected x to be finite.
My x, namely M1_LFP1, is a vector 1358x1, what is the problem?

채택된 답변

dpb
dpb 2022년 10월 24일
x=load('\\fs01.hpc.unipr.it\bonini01\WIRELESS_Wifi_Router_Impianti2021\Acquisizioni Deuteron\ProvaHyper_20220915_M1\LFP1.mat');
input=x.LFP1;
M1_LFP1=rmmissing(input);
sum(~isfinite(M1_LFP1))
will show you how many elements are NOT finite in your input data -- some clearly are.
isBad=~isfinite(M1_LFP1);
will return the actual locations in logical addressing vector that you can see whether are nan or inf; you can, of course, count/find each of those with the appropriate functions isnan, isinf

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by