MATLAB Answers

Finding index/location of 'WidthRefe​rence','ha​lfheight' after using findpeaks

3 views (last 30 days)
Jeffrey Houston
Jeffrey Houston on 6 Jan 2021
Hello all,
As the title briefly describes, I am looking to find either the index or location of the yellow Width line that can be found in the example here:
The image I am particularly observing is this one which is about 3/4 down the page.
Basically, I am looking to recreate the width line, and obtain its points in a dataset.
To clarify, I am looking to obtain the location or index of the yellow width line. What is of most interest is the third peak from the left; the Height line is not centered about the Width line. When I was trying to recreate the width line, I assumed the peak to be in the middle of this width line, and take the width from the findpeaks function as follows:
[pks,locs,widths,proms] = findpeaks(y,x,'WidthReference','halfheight');
I then halved the width, and put it on both sides. However, as mentioned, because the height line is right in the middle of the width line, this results in an offset recreation of this width line.
Please help! I am not permitted to post code for this particular problem. Thank you.

Answers (0)

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!