MATLAB Answers

How to combine the using of meshgrid and surface?

25 views (last 30 days)
Levi on 2 Dec 2020
Commented: Levi on 2 Dec 2020
The value of the graph are
x = [ 0.02];
y = [ 0.35];
z = [ 1];
I am trying using this one but it wont work
[xx,yy = meshgrid(x,y)


Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Dec 2020
x = linspace(0,.1);
y = linspace(.3, .4);
[X, Y] = meshgrid(x, y);
Z = X.^2 - 5.*Y.^3 + sin(5*2*pi*X);
surf(X, Y, Z, 'edgecolor', 'none')
You cannot surf() a single point. If you need to draw one 3d point at a time, use either plot3() with a marker set, or use scatter3() (for lots of points, consider using a pointcloud)

  1 Comment

Levi on 2 Dec 2020
thank for the knowledge mate. Help me alot

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by