help-octave
[Top][All Lists]
Advanced

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

Re: Plotting with octave


From: Alfredo Tomasini
Subject: Re: Plotting with octave
Date: Thu, 17 Aug 2000 09:14:58 -0700

Eric Bouyoux wrote:

> I would like to generate a plot of the function toto = x^2
>
> I wrote the following program :
>
> function y = toto (x)
> y = x^2;
> endfunction
>
> x = (0:1:20)';
>
> gplot toto(x)  with linespoints
>
> I get the following error message :
>
> error: for A^b, A must be square
> error: evaluating assignment expression near line 2, column 3
> error: called from `toto'
>
> Is anybody able to help me to understand how the gplot function works.
>
> Thank you.
>
> Regards.
>
> Eric Bouyoux

Try

x = 0:1:20;
y= x..^2;
data = [x',y']
gplot data u 1:2

In the manual there is an example, return the fanction values in term of
vector.




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

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



reply via email to

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