3d surfaces in matlab

1 visualización (últimos 30 días)
Cyrus
Cyrus el 31 de Jul. de 2013
Hi everybody,
I'm relatively new to plotting 3d surfaces and am looking for help. I have some sets of data to work with (say, 3 columns), and was wondering if someone can show me a basic example of how to plot a 3d surface with a x,y,z axis.

Respuesta aceptada

Marc
Marc el 31 de Jul. de 2013
doc surf doc mesh
k = 5;
n = 2^k-1;
[x,y,z] = sphere(n);
c = hadamard(2^k);
surf(x,y,z,c);
colormap([1 1 0; 0 1 1])
axis equal
figure;
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
mesh(Z);
Straight from the documentation. You can also look for "GEOM3D" in the file exchange. This is a nice toolbox for creating 3d images. The code is there for you to dig into.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by