NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/basics/ri_to_ap_deg.m

Revision 495 (checked in by cbc, 11 years ago)

Initial import of Stark code.

Line 
1 % RI_TO_AP_DEG   Convert real/imaginary vectors to amplitude/phase(deg)
2 %
3 % RI_TO_AP_DEG   Convert real/imaginary vectors to amplitude/phase,
4 %                assuming the phase is to be output in degrees.
5 %                RI_TO_AP_DEG(re,im) returns the amplitude and phase
6 %                components in a two-column matrix as [amp,pha].
7 %
8 %                Call as: [A,P]=ri_to_api_deg(re,im);
9 %
10 function [A,P]=ri_to_api_deg(re,im)
11
12 deg_to_rad = pi/180.;
13
14 A=sqrt(re.*re.+im.*im);
15 P=atan2(im,re))/deg_to_rad;
16
17 return
18
Note: See TracBrowser for help on using the browser.