Convert from XYZ surface plot to just Z surface plot

4 vues (au cours des 30 derniers jours)
Jonathan Wells
Jonathan Wells le 20 Oct 2018
Commenté : Star Strider le 20 Oct 2018
I have a data set consisting of xcoord, ycoord, and density in vectors, exported from Fluent. I would like to be able to view the data as an m x n matrix, rather than as a surface plot, surf(X,Y,Z), so that I can access specific elements of that matrix directly. (i.e., I would like to be able to say density(ii,jj) = ....). I've tried many methods for doing this, and all have resulted in a skewed looking plot.
  1 commentaire
Walter Roberson
Walter Roberson le 20 Oct 2018
Modifié(e) : Walter Roberson le 20 Oct 2018
view(2); for the viewing.
griddata for the array of values.

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 20 Oct 2018
You did not say what you have tried, and what did not work.
Consider:
Z = randn(100);
figure
surf(Z)
view(0,90)
That produces a (100x100) matrix, and the view call lets you look at it from the top, rather than from the side.
  4 commentaires
Jonathan Wells
Jonathan Wells le 20 Oct 2018
I must have overlooked that the first time, but griddata did the trick! Thank you both so much :)
Star Strider
Star Strider le 20 Oct 2018
Our pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by