how to plot a 2D matrix to a 3D graph

12 vues (au cours des 30 derniers jours)
raed khader
raed khader le 1 Fév 2017
Commenté : Amit Kumar le 14 Oct 2020
given a 2D matrix of size( x * y ) where each element contains a numeric value Z , how to plot the Z value in a 3D graph as a function of both x and y such that Z = matrix(x,y) ?
I have tried using meshgrid to create a 2D array of size(x,y) and defined a new function F = matrix(x,y) and finally used surf(x,y,F) to plot the data but it gave me an empty graph.
  4 commentaires
John Chilleri
John Chilleri le 1 Fév 2017
Good to hear!
Amit Kumar
Amit Kumar le 14 Oct 2020
Dear John,
what is 120x160 X matrix. I have the same problem. For eg. I have a matrix
2 3 2.5 5 7 6
4 8 5.6 7 8 9
8 9 4.7 4 2 8
All these value are of Z. then what should be X and Y matrix

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur 2-D and 3-D 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!

Translated by