如何在GNU Octave中绘制2个平面

时间:2014-04-13 10:03:45

标签: math plot octave plane

我想在同一图中绘制两架飞机,我该怎么做?

x + y + z = 1
2x - y + 3z = 4

谢谢!

1 个答案:

答案 0 :(得分:7)

显示平面的xy范围:

X = linspace(-100,100,10);
Y = linspace(-100,100,10);
[ XX, YY ] = meshgrid(X,Y);

计算飞机的z坐标:

ZZ1 = 1 - XX - YY;
ZZ2 = 4/3 - 2/3 * XX + 1/3 *YY;

显示:

figure;
hold on;
mesh(XX,YY,ZZ1);
mesh(XX,YY,ZZ2);

enter image description here