input freqRange in bandpower doc example returning an error when it is a Mx2 matrix
Afficher commentaires plus anciens
Hello,
While reading the doc of the function bandpower, I tried the example Percentage of Power in Frequency Bands (Periodogram) (in MATLAB online).
The line
powBands = bandpower(Pxx,F,[50 150;200 300],"psd");
returned the following error:
Error using bandpower
Expected input number 3, FREQRANGE, to be a vector.
Error in bandpower>psdbandpower (line 152)
validateattributes(freqrange,{'numeric'},{'vector','finite','real',...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in bandpower>timedomainbandpower (line 110)
pwr = psdbandpower(Pxx,F,freqrange);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in bandpower (line 65)
pwr = timedomainbandpower(inputArgs{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
which is quite incomprehensible, as the input description stipulate:
Frequency range for the band-power computation, specified as a two-element real-valued vector or as an M-by-2 real-valued matrix. M is the number of intervals along which to compute the band power.
Did I miss something ?
Best regards,
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spectral Measurements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
