function y = decay(t,etc); %function y = decay(t,etc); % % Decay function exp(-t/t0)*cos(omega*t) % t = list of times % etc contains t0, omega % t0 = time constant % omega = radian frequency % error(nargchk(2,2,nargin)); t0 = etc(1); omega = etc(2); y = exp(-t/t0).*cos(omega*t);