Plotting 2 Matrices
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I'm having difficulty constructing a plot. I have two 2D matrices of the same size, matrix one contains elevation data (a cross section of a 3D matrix), matrix two contains attribute data of the same points contained in matrix one. I'm trying to construct a plot that preserves the elevation data and does a color shading based on the attribute values contained in matrix two.
I plot matrix one with using the following: for n = 1:300 plot(matrix one(n,:)) hold on end
This produces a plot with a series of cross sections stacked on top of each other. I'd like to preserve the appearance of this plot while shading it using the values in matrix two. Basically, I want the position of a point to be based on it's value in matrix one and the color based on it's value in matrix two. I hope I've explained this clearly enough. I'd appreciate any help.
Thanks.
0 commentaires
Réponses (1)
Honglei Chen
le 12 Avr 2012
You can try
surf(matrix1,matrix2)
and see if that's what you want.
2 commentaires
laurie
le 13 Avr 2012
pcolor(matrix2) can do a color shading, but I don't know about the 3D aspect of your problem..
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!