# amsfunctions: Matlab toolbox by A. M. Steane

This tool-box is a set of m files for data analysis tasks such as curve fitting, some mathematical functions such as elliptic integrals, function minimisation and a few general-purpose functions.

These are work-horse functions designed to make moderately advanced methods easily available. For example, integ is fast and precise, slf alerts the user in the case of poor fit, amsfit is flexible, findpeaks is robust, etc. The functions address three main areas: working with experimental data, optimisation, and tasks such as integration and inversion when you don't have the explicit function, only evaluations of it (or data points). Some powerful numerical methods are employed, but without detailed treatment of special cases. Some of the methods are taken from Numerical Recipes, 2nd ed (W. H. Press, S. A. Teukolsky, W. T. Vettering, B. P. Flannery, Cambridge 1994). Thanks also to S.C. Webster for some of the atomic physics.

### Highlights

 slf.m a thorough application of straight line fit, including information on goodness of fit etc. amsfit.m a flexible curve fitting routine findpeaks a good-quality peak finder for use with noisy data ...fit.m various quick fit functions, e.g. sin, exp, Gaussian, Lorentzian, polynomial anneal.m simulated annealing integ.m, differ.m numerical integration and differentiation when you have the data but not the functional form

### Contents

Functions for numerics and data analysis. A.M. Steane
version 2.2 22-Oct-2007

 general math: bcf, fact, differ, integ, myfft, convolve, whatis minimisation: anneal, amebsa, fminfast, fminbrac misc: adisp, sigfig, unspace, members, findcolour plotting: aplot, visualize, errbar, logcontour, plotaxes, nicefig atomic physics: lande, cg, clebsch, sixj, threej, cjk, iondata probability: binomial, pexp, poisson, bnldev, poidev data fitting: slf, amsfit, errfit, rescale, findpeaks, lowpass, asmooth vector methods: vzero, vinvert, regularize, findord functions: sinval, expval, lorval, gaussval, ellipf/e/pi quick fit: sinfit, expfita, lorfit, gaussfit, powerlaw, polyfast