help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: an array with negative index


From: Mike Miller
Subject: Re: an array with negative index
Date: Mon, 23 Aug 2004 09:30:28 -0500 (CDT)

On Mon, 23 Aug 2004, Jean-Michel besnard wrote:

I wish to plot a distribution that could look like:
coefficient value: -4  -3  -2  -1  0  1  2  3  4
number of hits:    0    5   9  12  17 18 13 5  1

since an array starts at 1, I can't possibly store the "number of hits" with an index corresponding to their "coefficient value".


The plot command allows you to specify both X and Y values. See "help plot" in octave. You need something like this:

Y = [0    5   9  12  17 18 13 5  1]';
X = [-4:4]';
plot(X,Y)

Mike

--
Michael B. Miller, Ph.D.
Assistant Professor
Division of Epidemiology
and Institute of Human Genetics
University of Minnesota
http://taxa.epi.umn.edu/~mbmiller/



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]