How to find the peaks (both x and y location)
Show older comments
Hello.
For instance, if I was plotting Scope (x) and Temperature (y), why can't I use the following code: [pks,locs] = findpeaks(Temperature)?
Matlab tells me that there is the following error: Error using findpeaks>parse_inputs (line 131) Expected a string for the parameter name, instead the input type was 'double'.
Error in findpeaks (line 71) [X,Ph,Pd,Th,Np,Str,infIdx] = parse_inputs(Xin,varargin{:});
It gives me the peaks when I simply use findpeaks(Temperature), but I need the corresponding x values to compute as well.
Could anyone please help me out? Thank you for your time!
5 Comments
pietro
on 12 Oct 2014
It would be useful if you upload the data so we can understand why this error arises.
David Barry
on 12 Oct 2014
Is your Temperature data definitely numeric and definitely a vector? Assuming your variable is called Temperature then check that both of the below return 1.
isnumeric(Temperature)
isvector(Temperature)
dj
on 13 Oct 2014
Image Analyst
on 13 Oct 2014
temps = Temperature(locs);
We can't do much more until you attach your code and data files.
Accepted Answer
More Answers (0)
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!