Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: syntax for polar complex numbers
Date: Tue, 3 Nov 2009 18:24:02 +0000 (UTC)
Organization: Xoran Technologies
Lines: 22
Message-ID: <hcpsg2$apq$1@fred.mathworks.com>
References: <hcpmeu$h1o$1@fred.mathworks.com> <hcpn1m$on9$1@fred.mathworks.com> <hcpnsf$i4n$1@fred.mathworks.com> <hcpopv$gg2$1@fred.mathworks.com> <hcpq52$b9b$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257272642 11066 172.30.248.38 (3 Nov 2009 18:24:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 18:24:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:582120


"Thomas " <loparna2000.removethis@yahoo.com> wrote in message <hcpq52$b9b$1@fred.mathworks.com>...

> I guess it's a matter of opinion.  I have a lot of these to do.  Would like to know simplest way.  Using cart2pol, easiest way would be the following:
> 
> [vre,vim] = cart2pol(0.465,1.01);
> (vre+i*vim)/(1+3i)
======================

Not if you write a function, as I suggested, that gives you X=(vre+i*vim) as its output.  If you did, this would reduce to one line,

result = myfunction(0.465,1.01) / (1+3i);





> You cannot, as you suggest, simply enter V=1.01+i*0.002. 
=====

Yes you can, but as I was careful to point out, you cannot do any computations with it: it is merely a way of carrying around the phasor data as a single object. To do computations, you would have to invoke a conversion function phasor2cart()  first, but note that if you do, the above syntax would simplify still further to

result = phasor2cart(V) / (1+3i);