help-octave
[Top][All Lists]
Advanced

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

Re: plotting even function


From: John B. Thoo
Subject: Re: plotting even function
Date: Sun, 20 Mar 2005 13:44:59 -0800

On Mar 20, 2005, at 1:25 PM, John B. Thoo wrote:

So, if you would allow me at least one more daft question, how do I tell Octave to use the real root so that the plot of y = x^(1/3) is symmetrical about the origin?

OK, this is how I've done it.

> x1 = -1:0.1:0; x2 = 0:0.1:1;
> plot (x1, -(-x1).^(1/3), x2, x2.^(1/3))  % odd symmetry
> plot (x1, (-x1).^(2/3), x2, x2.^(2/3))   % even symmetry

But is there a more elegant way?

TIA again.
---John.



-------------------------------------------------------------
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]