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

root/gliderproc/trunk/MATLAB/opnml/FCAST_1.2/matlab_cen/ri_to_ap_deg_cen.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
19 %
20 %        Brian O. Blanton
21 %        Curriculum in Marine Sciences
22 %        15-1A Venable Hall
23 %        CB# 3300
24 %        Uni. of North Carolina
25 %        Chapel Hill, NC
26 %                 27599-3300
27 %
28 %        919-962-4466
29 %        blanton@marine.unc.edu
30 %
31
Note: See TracBrowser for help on using the browser.