필터 지우기
필터 지우기

I want to use contourf function to plot 2d velocity data

조회 수: 28 (최근 30일)
Mandar Kadwekar
Mandar Kadwekar 2022년 7월 13일
댓글: Mandar Kadwekar 2022년 7월 14일
I have the x,y and corersponding velocity components u and v as a matrix data. I want to use this matrix data to plot a contour of velocity.
I went tried already using the Matlab database but I don't get epected results. It is hard to interpret the code given in the database, do if anyone can help to relate the code with the velocity data I have would be a big help.
  댓글 수: 3
Mandar Kadwekar
Mandar Kadwekar 2022년 7월 13일
Thanks for your reply,
can I apply contourf if I have a a total velocity magnitude matrix dpendent on X&Y. I want to produce results similar to the picture I have attached.
Star Strider
Star Strider 2022년 7월 13일
Without the data themselves to work with, the only suggestion I have is to create a vector from ‘u’ and ‘v’ using the hypot function. It is relatively straightforward to interpolate ‘x’, ‘y’, and the resulting magnitude vector created by hypot to matrices to use with contourf.

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

채택된 답변

KSSV
KSSV 2022년 7월 13일
Let u,v be your velcity matrices.
w = sqrt(u.^2+v.^2) ;
figure(1)
pcolor(x,y,w) ; % if throws error, transpose w
colorbar
shading interp
figure(2)
contourf(x,y,w)
  댓글 수: 3
KSSV
KSSV 2022년 7월 14일
It should show you arrow plots on pcolor. Attach your data and code.
Mandar Kadwekar
Mandar Kadwekar 2022년 7월 14일
thanks for the help, I got the result now. I was just using wrong varaible.

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

추가 답변 (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