Effacer les filtres
Effacer les filtres

Contour Plot from Coordinates

5 vues (au cours des 30 derniers jours)
Michael
Michael le 22 Avr 2013
Commenté : Udit Srivastava le 10 Jan 2017
Right now I have a matrix with x-coordinates, matrix with y-coordinates, and a matrix with pressure values at these points. I'm trying to create a pressure contour plot based on the pressure values at these points, but I cannot seem to figure it out. Could anyone point me in the right direction of how to accomplish this? Any help would be much appreciated!

Réponse acceptée

Kye Taylor
Kye Taylor le 22 Avr 2013
Modifié(e) : Kye Taylor le 22 Avr 2013
I will assume you have three vectors: x, y, and z (where z represents pressure). For example
x = rand(1,100);
y = rand(1,100);
z = x.^2 + y.^2;
Then, you can try
[xi, yi] = meshgrid(...
linspace(min(x),max(x)),...
linspace(min(y),max(y)));
zi = griddata(x,y,z, xi,yi);
contour(xi,yi,zi)
  2 commentaires
Michael
Michael le 22 Avr 2013
Worked great! Thanks for quick response.
Udit Srivastava
Udit Srivastava le 10 Jan 2017
surely, this worked great. But the contour that I got looks like a quarter of a circle. Can you please tell me how to get a contour like a full circle. Thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Contour 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