How do you find the Full Width Half Maximum from this graph?

This is a section of my code that graphs the data from an imported wdf file (picture provided). I need help writing a code that will produce a FWHM graph from the curve seen in the picture. Can you help me please as I am new to Matlab and have no idea what to put?
spec1 = SPECTRA(4,:);
Eg = (XLIST<1150 & XLIST > 950);
Eg=+Eg;
plot(XLIST,spec1)

2 件のコメント

Aquatris
Aquatris 2018 年 7 月 19 日
編集済み: Aquatris 2018 年 7 月 19 日
see here or many other more related questions in this website.
Nichole Lanham
Nichole Lanham 2018 年 7 月 19 日
編集済み: Nichole Lanham 2018 年 7 月 19 日
I changed my code following the one from the link. I ended up with this graph shown below. How would I go about fixing the graph? The blue function should be centered and the red lines providing the FWHM?
spec1 = SPECTRA(4,:);
Eg = (XLIST<1150 & XLIST > 950);
Eg=+Eg;
plot(XLIST,spec1)
grid on;
oneProfile = spec1;
maxValue = max(oneProfile);
aboveHalfMax = oneProfile>maxValue/2;
firstIndex = find(aboveHalfMax,1,'first');
lastIndex = find(aboveHalfMax,1,'last');
hold on;
line([firstIndex firstIndex],[0 maxValue/2],'Color','r','LineWidth',2);
line([lastIndex lastIndex],[0 maxValue/2],'Color','r','LineWidth',2);
line([firstIndex lastIndex],[maxValue/2 maxValue/2],'Color','r','LineWidth',2);

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraph and Network Algorithms についてさらに検索

質問済み:

2018 年 7 月 19 日

編集済み:

2018 年 7 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by