필터 지우기
필터 지우기

Contour Plot from Coordinates

조회 수: 5 (최근 30일)
Michael
Michael 2013년 4월 22일
댓글: Udit Srivastava 2017년 1월 10일
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!

채택된 답변

Kye Taylor
Kye Taylor 2013년 4월 22일
편집: Kye Taylor 2013년 4월 22일
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
Michael
Michael 2013년 4월 22일
Worked great! Thanks for quick response.
Udit Srivastava
Udit Srivastava 2017년 1월 10일
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!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by