% df.m % %% return n-th derivative function deriv = df(instr, var, n) if(nargin==2) , n=1; end locstr=instr; for k=1:n locstr=diff(locstr,var); end deriv=locstr;