[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Three-Dimension plot
From: |
tmacchant |
Subject: |
Re: Three-Dimension plot |
Date: |
Wed, 14 Sep 2016 03:00:36 -0700 (PDT) |
The original post to sent to nabble but has not been accepted to the ML yet.
The url
http://octave.1599824.n4.nabble.com/Three-Dimension-plot-td4679745.html
Reply
You forgot . operator before * operator.
(wrong) z = (x - 1).^2 * (x - 2).^2 + (y - 1).^2;
(right) z = (x - 1).^2 .* (x - 2).^2 + (y - 1).^2;
Try
x=linspace(0,3,51);
y=linspace(-1,3,51);
[x, y] = meshgrid(x, y);
z = (x - 1).^2 .* (x - 2).^2 + (y - 1).^2;
mesh(x, y, z);
Screenshot is attached.
<http://octave.1599824.n4.nabble.com/file/n4679754/test.png>
Tatsuro
--
View this message in context:
http://octave.1599824.n4.nabble.com/Three-Dimension-plot-tp4679745p4679754.html
Sent from the Octave - General mailing list archive at Nabble.com.