Effacer les filtres
Effacer les filtres

3d surfaces in matlab

1 vue (au cours des 30 derniers jours)
Cyrus
Cyrus le 31 Juil 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.

Réponse acceptée

Marc
Marc le 31 Juil 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.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by