home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / utils / mathstud / angle.m < prev    next >
Encoding:
Text File  |  1995-05-19  |  224 b   |  10 lines

  1. function y = angle(expr)
  2. % y=angle(x)
  3. % x - input argument (usually complex)
  4. % y - phase angle, in radians, of x
  5.  
  6. if (nargin ~= 1)
  7.     error('angle() takes only one argument')
  8. end
  9. y = atan2(imag(expr), real(expr));
  10.