MATLAB Answers

Tino
0

finding x axis in findpeaks

Asked by Tino
on 28 May 2019
Latest activity Commented on by Tino
on 28 May 2019
Hello
Please I am able to find the peak of my plot
using
pks = findpeaks(m);
This only shows me the values on the y axis
I want to find the corresponding values in the x axis too. Also I will like results of the x axis to come out in the multiple of 2 ( x * 2)
I will be grateful for any help
thanks
Tine

  0 Comments

Sign in to comment.

Tags

Products


Release

R2019a

1 Answer

Adam
Answer by Adam
on 28 May 2019
 Accepted Answer

doc findpeaks
clearly shows there are numerous ways to call the function, including:
[pks,locs] = findpeaks(data)
where locs is the index locations of the peaks given in pks.
Reading the documentation should always be your first stop when you want to know how to do something, especially with a function you have already identified so that it is simple to go to the help page of!

  1 Comment

Tino
on 28 May 2019
Thanks Adam
sorted!!

Sign in to comment.