Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: imag and real don't work
Date: Thu, 24 Jul 2008 11:13:08 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 37
Message-ID: <g69o44$e5b$1@fred.mathworks.com>
References: <g69nj3$9he$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
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 1216897988 14507 172.30.248.38 (24 Jul 2008 11:13:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jul 2008 11:13:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:481480



"Sandra " <smh31.nospam@sussex.ac.uk> wrote in message 
<g69nj3$9he$1@fred.mathworks.com>...
> I am sure this must be a simple thing, but it is doing my
> head in!!! imag and real don't work for me see below:
> 
> >> real(0.0116 + 0.3333i)
> ??? Subscript indices must either be real positive integers
> or logicals.
> 
> >> real(2+3*i)
> ??? Subscript indices must either be real positive integers
> or logicals.
> 
> >> imag(2+3*i)
> ??? Subscript indices must either be real positive integers
> or logicals.
> 
> 
> the last two are from the matlab example! what am I doing wrong?
> 
> any advice appreciated,
> sandra

Every single new user does this. They create
a variable with the name of a function they 
will later use.

Have you created variables named imag and
real? What should Matlab do when it sees
variables with that name, but you try to use
the functions of the same names?

Just for kicks, now create variables named
quit and exit, as well as clear. Make your life
interesting. ;-)

John