Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: imag and real don't work
Date: Thu, 24 Jul 2008 11:08:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <g69nqj$bg1$1@fred.mathworks.com>
References: <g69nj3$9he$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216897683 11777 172.30.248.37 (24 Jul 2008 11:08:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jul 2008 11:08:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1338633
Xref: news.mathworks.com comp.soft-sys.matlab:481479



"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?


Check that you haven't assigned anything to i. i and j
should be reserved for complex numbers. type 'clear i' in
command window and then try again.
dave