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

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

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

Initial import of Stark code.

Line 
1 % RI_TO_AP_RAD   Convert real/imaginary vectors to amplitude/phase(rad)
2 %
3 % RI_TO_AP_RAD   Convert real/imaginary vectors to amplitude/phase,
4 %                assuming the phase is to be output in radians.
5 %                RI_TO_AP_RAD(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_rad(re,im);
9 %
10 function [A,P]=ri_to_api_rad(re,im)
11
12 A=sqrt(re.*re.+im.*im);
13 P=atan2(im,re));
14
15 return
16
Note: See TracBrowser for help on using the browser.