How to interpolate the local peak elevation to obtain the profile ?
Mostrar comentarios más antiguos
Excuse me everyone. I have the peak point location in the figure attachement. I want to interpolate each peak point to get the profile as in the red color in the figure. How can I solve this problem ? Thank you very much.

Respuestas (1)
Star Strider
el 16 de Jun. de 2022
0 votos
One option is the envelope function. Choose the 'peak' option and an appropriate value for the window length.
14 comentarios
Lyhour Chhay
el 16 de Jun. de 2022
Star Strider
el 16 de Jun. de 2022
I doubt that the envelope funciton can do any better than that with other ‘np’ values.
One option I can think of to get that result is to use findpeaks with 'MinPeakHeight' and 'MinPeakDistance' and then just connect the results (using the ‘locs’ output to index into the data).
You will have to experiment.
Lyhour Chhay
el 16 de Jun. de 2022
Star Strider
el 16 de Jun. de 2022
Use the ‘locs’ output to index into the appropriate vectors:
xpoints = x(locs);
ypoints = y(locs);
.
Lyhour Chhay
el 16 de Jun. de 2022
Star Strider
el 16 de Jun. de 2022
That is because there is no ‘locs’ variable! (I was referring to the findpeaks documentation convention for the output names.)
Use ‘loc’ instead, since that’s what you named it.
Lyhour Chhay
el 16 de Jun. de 2022
Star Strider
el 16 de Jun. de 2022
O.K. I did not initially see that you were using ‘Xp’ in your findpeaks call. If you want to use ‘loc’ as an index, remove that reference. The ‘loc’ output will then be in terms of the indices.
Lyhour Chhay
el 16 de Jun. de 2022
Star Strider
el 16 de Jun. de 2022
That depends on what you want to do.
I would just connect the ‘xpoints’ and ‘ypoints’ values with a line and enjoy the result.
Lyhour Chhay
el 16 de Jun. de 2022
Star Strider
el 16 de Jun. de 2022
My pleasure!
No inconvenience at all!
I saw that post, however I have no idea how to help you with it.
Lyhour Chhay
el 16 de Jun. de 2022
Star Strider
el 16 de Jun. de 2022
My pleasure!
Categorías
Más información sobre Descriptive Statistics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

