How find FWHM for large numbers of plots?
1 view (last 30 days)
Here simply if i want to write the matlab code to find the fwhm (up to 4 or 5 digits) of like following curve, i have to find x values difference corresponding to average value of y. Since x values at average y do not lie at y data points hence i required interpolate values of x. Pls help regarding to this.
for example take below plot and data
Here i have to find x values difference at y=12.5 to determine the fwhm ,of respective curve. How can i write in code?
Star Strider on 26 Jul 2020
for k = 1:numel(x)
y(k) = z;
[miny,idx] = min(y);
left_x = interp1(y(1:idx),x(1:idx), y(1)/2)
right_x = interp1(y(idx:end),x(idx:end), y(1)/2)
plot([left_x right_x], [1 1]*y(1)/2, '+r')
There is no ‘full width-half-maximum’ because ther is no defined maximum. This code finds the approximate values for ‘full-width-half-minimum’ instead, since only that makes sense in this context.