How to fix pmtm function error messages for PSD calculation for a given frequency range
Show older comments
Following the MATLAB tutorial on pmtm, I ran the following code to estimate PSD of delta waves on an eeg signal, where fs is 256 and f is a vector from 0Hz to 4Hz
pmtm(smoothdata,[0 4],256)
However I get the following error message
Error using pmtm>getOptions
Number of columns of E and length of V do not match.
Error in pmtm>parsepmtmOptions (line 436)
params = getOptions(x,taperType,dropLast,confLevel,varargin{:});
Error in pmtm (line 166)
params = parsepmtmOptions(x,varargin{:});
The code runs well for all other options, but whenever I add the f variable, I get an error message.
Here is another trial I tried to run while specifying tapers.
pmtm(smoothdata,10,length(smoothdata),'Tapers','sine',[0 4],256)
and this is the error message i get,
considering the MATLAB instruction specifies that the last argument should be Fs, I don't see where I went wrong.
Error using pmtm
Expected FS to be a scalar.
Error in pmtm>getOptions (line 668)
validateattributes(varargin{i},{'numeric'},{'scalar',...
Error in pmtm>parsepmtmOptions (line 436)
params = getOptions(x,taperType,dropLast,confLevel,varargin{:});
Error in pmtm (line 166)
params = parsepmtmOptions(x,varargin{:});
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!