Error using pwelch - Expected x to be finite.

55 Ansichten (letzte 30 Tage)
Felicia DE CAPUA
Felicia DE CAPUA am 24 Okt. 2022
Kommentiert: Felicia DE CAPUA am 25 Okt. 2022
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?

Akzeptierte Antwort

dpb
dpb am 24 Okt. 2022
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

Weitere Antworten (0)

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by