Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Negative indices in arrays
Date: Sun, 14 Jun 2009 22:44:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <h13ufi$438$1@fred.mathworks.com>
References: <h11ecd$mps$1@fred.mathworks.com> <h11jj9$fd9$1@fred.mathworks.com> <h11nq9$73l$1@fred.mathworks.com> <h13hde$qlc$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.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 1245019442 4200 172.30.248.38 (14 Jun 2009 22:44:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 14 Jun 2009 22:44:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:547380


Hi Chris,

Why would you need non-positive indices? I could not go through your code exactly, so I will not be able to be specific about the problem. How about this simple example. Maybe it is clearer if we talk on this new small piece of code:

n = -10:0.5:10;
Dn = n.^2;

Now, we have Dn as a function of n. It is clear that length(n) is 41. So now, n(1) is -10, n(2) is -9.5, ..., n(41) = 10. Therefore, if you need the value of Dn at n = -9 for example, you can get it by Dn(3), right? Since n(3) = -9.

Please let me know if I understood your question correctly. If not, please give an example which is similar to the above one.

"Chris G" <n4cag@yahoo.com> wrote in message <h13hde$qlc$1@fred.mathworks.com>...
> 61 views and only one person has been able to help me?  All I'm looking for is how to get Matlab to plot the negative indices for my array of numbers in Dn...