![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/533784/image.png)
How plot to matrices in 3D
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MOHD UWAIS
le 27 Fév 2021
Commenté : MOHD UWAIS
le 28 Fév 2021
How I could plot following matrices in 3D. Here rows and columns of z matrix show to data, which are to plot with x and y.
x=1:5;
y=3:5;
z=[-1 2 3; -5 -1 3; -2 4 8; 1 3 7; 4 7 10];
0 commentaires
Réponse acceptée
Image Analyst
le 27 Fév 2021
Some possible options:
x=1:5;
y=3:5;
[X, Y] = meshgrid(x, y)
z = [-1 2 3; -5 -1 3; -2 4 8; 1 3 7; 4 7 10]
subplot(2, 1, 1);
surf(X, Y, z')
xlabel('x', 'FontSize', 12);
ylabel('y', 'FontSize', 12);
zlabel('z', 'FontSize', 12);
subplot(2, 1, 2);
bar3(z')
xlabel('x', 'FontSize', 12);
ylabel('y', 'FontSize', 12);
zlabel('z', 'FontSize', 12);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/533784/image.png)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!