Program name: t2fit

OS: Runs on both LINUX and Solaris systems

Usage: This program is used for fitting a decaying exponential to a number of data points.

Syntax: The syntax for running the program is as follows:

$ t2fit < number of parameters (npr) > < number of points (npt) >
< time points file (xdata) > < intensity points file (ydata) > < matlab output file (*.m) >
Thus, the program requires 5 arguments. The first argument, npr, can be either 2 or 3. If npr=2, then the fitted exponential is:
a1*exp(-t/a2)
with two parameters a1 and a2 to be estimated from the data. If npr=3, then the fitted exponential has the following form:
a1*exp(-t/a2)+a3
where the three parameters a1, a2, and a3 are estimated from the data.

The second argument, npt, is the number of points to be fitted. For example, npt can be the number of echoes in a multi-echo experiment.

The third argument, xdata, is the name of an ascii file containing npt data points (one data point per line). These data points are the x-axis (time) points. The fourth argument, ydata, is the name of an ascii file containing npt data points representing the y-axis (intensity) data. Thus, each data point in xdata has a corresponding point in ydata. Together, they make a pair representing a point on the xy plane through which the exponential is to be fitted.

The last argument, *.m, is a filename where matlab instructions will be written for plotting the fit. The fit can be viewed by starting matlab and running these instructions by simply typing the name of the file without the .m extension.

Example: The following command fits a two parameter decaying exponential to 4 data points located in the ~ardekani/src/expfit/xdata2 and ~ardekani/src/expfit/ydata2 files.

$ t2fit 2 4 ~ardekani/src/expfit/xdata2 ~ardekani/src/expfit/ydata2 showfit.m
Have a look at the format of the xdata2 and ydata2 files. Run the command. Execute showfit on matlab to view the fit.