Peak Width at Half Height
Afficher commentaires plus anciens
I started using MATLAB only a few days ago. And I have trouble finding the width of peak. I have two subplots, both of which represent one peak from the data only. I want to know the width of peak at half distance. I also want the line representing width to be displayed on the plot. Please tell me how this can be done.
I searched the internet for help but could not get the desired result.
Here is my code for both graphs:
subplot(2,1,1)
plot(Hwave,Hintense,'.'),title('Original data'),xlabel('Wavelength'),ylabel('Intensity')
axis tight, grid
subplot(2,1,2)
plot(Hwaveinter,Hreal,'.'),title('Eight Times Interpolated Data'),xlabel('Wavelength'),ylabel('Intensity')
axis tight, grid
Thanks
3 commentaires
Could we see an example curve or two? A simple approach would be shift the curve so its baseline is a y=0 find the peak using max(), find the corresponding y value at half the height of the peak, and then get the corresponding x values on each side of the curve where y equals half-height. But that simple approach may not work with some curves.
Laiba Qadeer
le 10 Mar 2020
Adam Danz
le 10 Mar 2020
Image Analyst's demo will work well with your data.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

