diff m-toolbox/classes/+utils/@math/phase.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/+utils/@math/phase.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,26 @@
+% PHASE return the phase in degrees for a given complex input.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: PHASE return the phase in degrees for a given complex
+%              input. Supposed to be analogous to angle but return degrees
+%              instead of radians.
+%
+% CALL:       p = phase(resp)
+%
+% INPUTS:     resp - complex number
+%
+% OUTPUTS:    p    - phase
+%
+% VERSION: $Id: phase.m,v 1.2 2008/09/25 11:10:35 ingo Exp $
+%
+% HISTORY: dd-mm-yyyy M Hewitson
+%             Creation
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function p = phase(resp)
+
+  p = angle(resp)*180/pi;
+
+end
+