Trouble using findpeaks : Too many output arguments.

Hello, I am using [pkt,lct,wt,ct]=findpeaks(data) to find the peakheight, location, width and prominence of the peaks in my data. This gives me error message 'Too many output arguments'.
However, When I am using [pkt, lct]=findpeaks(data), there is no error. Please suggest the solution. Please help.

 Accepted Answer

The ‘expanded’ findpeaks return syntax is new to R2014b. The online documentation defaults to the most recent release, so will not necessarily be correct for prior releases as well.

2 Comments

Thanks. I suppose mine is R2014a since I am getting following answer to which -all findpeaks
/Applications/MATLAB_R2014a.app/toolbox/signal/signal/findpeaks.m /Applications/MATLAB_R2014a.app/toolbox/signal/signal/@dspdata/findpeaks.m
My pleasure.
If I remember correctly, MATLAB licenses cover the full year, so you should be able to download and install R2014b as part of your current license. That will give you access to the new version of findpeaks.
Don’t uninstall R2014a, because the HG2 graphics in R2014b take a bit of time to learn. HG2 also has less flexibility than previous versions of MATLAB graphics (at least in my opinion).

Sign in to comment.

More Answers (1)

What version are you using? Is it possible that the 3rd and 4th outputs were added in a later version than you have? What does the help documentation say - does it list all 4 output arguments? What does this say
which -all findpeaks

1 Comment

Getting this /Applications/MATLAB_R2014a.app/toolbox/signal/signal/findpeaks.m /Applications/MATLAB_R2014a.app/toolbox/signal/signal/@dspdata/findpeaks.m

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!