No BSD License  

Highlights from
Numerical Methods for Physics

from Numerical Methods for Physics by Alejandro Garcia
Companion Software

fund(x,n)
function f = fund(x,n)
%  Return function value or derivative
%  fund(x,0) returns the value of the function
%  fund(x,n) returns the value of the nth derivative
%             if n=1 or 2 else an error
if( n == 0 )
  f = sin(x);
elseif( n == 1 )
  f = cos(x);
elseif( n == 2 )
  f = -sin(x);
else
  error('Error; bad value for n in fund')
end
return;

Contact us at files@mathworks.com