summaryrefslogtreecommitdiff
path: root/macros/fwhmjlt.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/fwhmjlt.sci')
-rw-r--r--macros/fwhmjlt.sci24
1 files changed, 23 insertions, 1 deletions
diff --git a/macros/fwhmjlt.sci b/macros/fwhmjlt.sci
index 4e9eb9c..129bffc 100644
--- a/macros/fwhmjlt.sci
+++ b/macros/fwhmjlt.sci
@@ -1,4 +1,26 @@
-function [f]=bitrevorder(y,varargin)
+function [f]=fwhmjlt(y,varargin)
+//This function Computes peak full-width at half maximum
+
+//calling sequence
+//f = fwhm (y)
+//f = fwhm (x, y)
+//f = fwhm (…, "zero")
+//f = fwhm (…, "min")
+//f = fwhm (…, "alevel", level)
+//f = fwhm (…, "rlevel", level)
+
+//Description
+//Compute peak full-width at half maximum (FWHM) or at another level of peak maximum for vector or matrix data y, optionally sampled as y(x). If y is a matrix, return FWHM for each column as a row vector.
+//The default option "zero" computes fwhm at half maximum, i.e. 0.5*max(y). The option "min" computes fwhm at the middle curve, i.e. 0.5*(min(y)+max(y)).
+//The option "rlevel" computes full-width at the given relative level of peak profile
+//The option "alevel" computes full-width at the given absolute level of y.
+
+//Example
+//t=-50:0.01:50;
+//y=(1/(2*sqrt(2*%pi)))*exp(-(t.^2)/8);
+//z=fwhmjlt(y)
+//Output: 470.96442
+
rhs = argn(2)
if(rhs<1 | rhs>5)
error("Wrong number of input arguments.")