main.m501 chars19 lines
This code generates a normal distribution with mean=0 and std deviation=1 using normpdf
function in Matlab. It then finds the maximum value and index of the curve. The half max value is calculated by dividing the max value by 2. Following that, the lower and upper indexes where the curve crosses the half-max value are found using find
function. Finally, the full width half max (FWHM) is calculated as the difference between the x-values at the upper and lower indexes.
gistlibby LogSnag