help-octave
[Top][All Lists]
Advanced

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

Re: plotting non-integer values


From: Ben Abbott
Subject: Re: plotting non-integer values
Date: Tue, 2 Oct 2007 08:39:43 -0400

The same example works for me.
I'm running octave 2.9.14 installed via Fink on OS X (10.4.10). What version of Octave are you using? Did you compile it? or obtain a binary from somewhere?

I've attached plot produced by your example, with the symbol "o" added to mark the points.

A=[1,2,3,4];
B=[1.1, 2.2, 3.3, 4.4];
plot (A,B,'-o');

I've attached the subsequent plot as well.

In any event, I'm still confused by the error "expecting an integer index value", which indicates the values of the index is non-integer. I've tried to force such an error, but get something different.

plot (A(B),B,'-o');
error: expecting integer index, found 1.100000
error: evaluating argument list element number 1

Can you post everything produced by the line below?

A, B, plot(A,B)

Attachment: test.pdf
Description: Adobe PDF document


On Oct 2, 2007, at 8:15 AM, M Devoto wrote:

Hi Ben,
thanks for you reply. I tried the following simple code to test what you said.
A=[1,2,3,4];
B=[1.1, 2.2, 3.3, 4.4];
plot (A,B);

and I still get the same error message because the vectors themselves have non integer values. Perhaps I'm missing something here...



--On 02 October 2007 07:50 -0400 Ben Abbott <address@hidden> wrote:

On Oct 2, 2007, at 7:19 AM, M Devoto wrote:

Hi. I'm a newbie to Octave so apologies for the dumb question.
I'm trying to plot two vectors with plot(x,y). However, one of the
vectors
has non-integer values and I get a "expecting an integer index
value" error
message. Is there a way around this? Any suggestions?
Thanks for your reply.
M.

Its not the values of the vectors that is the problem, but the value  of
the *indices*.

Are you actually doing something like plot(x(n),y(n))?

If so what are the values of "n"?


reply via email to

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