Info

此问题已关闭。 请重新打开它进行编辑或回答。

3d dimensional surface

1 次查看(过去 30 天)
Biha Dirks
Biha Dirks 2019-5-12
关闭: MATLAB Answer Bot 2021-8-20
I'm trying to plot a 3d dimensional surface. The function given is The code below is the one I'm using.
v = [-2:0.1:2];
w = [-2:0.1:2];
[X,Y] = meshgrid(v,w);
Z = 6*X^2-4*X^2*Y^2;
figure(3);
surf(X,Y,Z)
And this is the output in MATLAB:
Now when I do this in Wolfram alpha i'm getting a much smoother surface. So I'm wondering what I am doing wrong: https://www.wolframalpha.com/input/?i=3d+plot+6x%5E2-4x%5E2y%5E2

回答(1 个)

G A
G A 2019-5-12
v = [-2:0.1:2];
w = [-2:0.1:2];
[X,Y] = meshgrid(v,w);
Z = 6*X.^2-4*X.^2.*Y.^2;
figure(3);
surf(X,Y,Z)
  4 个评论
Biha Dirks
Biha Dirks 2019-5-24
It is much smoother now but It's still not the same as the 3D plot on Wolfram Alpha.
G A
G A 2019-5-24
Not the same in which way? 3D plot on Wolfram Alpha has different limits for X and Y than those of yours given by v and w.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by