How to combine the using of meshgrid and surface?

9 views (last 30 days)
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)
figure;
surf(xx,yy,zz);

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)

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!