What is wrong with this seemingly simple test clc() n=[1:20] z=exp(%i*2*%pi.*n./10) phz=atan(imag(z),real(z)) ifq=diff(phz) ifq=[ifq,ifq($)] plot(n,phz,n,ifq) The lengths of all vectors are 20 yet I get an error 21 index error Thanks Gary Nelson gnelson at quantasonics.com