필터 지우기
필터 지우기

how to get a plot quiver with velocity magnitude

조회 수: 3 (최근 30일)
bharathi Dasari
bharathi Dasari 2019년 11월 24일
댓글: Daniele Morandi 2022년 11월 25일
How to get a quiver plot with change in color basing on velocity vector magnitude

답변 (1개)

Priyanshu Mishra
Priyanshu Mishra 2019년 11월 27일
Hi Bharathi,
You can use 'color' linespec to change the color of your velocity vectors. For your reference I have written a code. You may take help of it.
[x,y] = meshgrid(0:0.2:2,0:0.2:2);
u = cos(x).*y;
v = sin(x).*y;
figure
quiver(x,y,u,v,'color',[1 0 0])
The above code will give you red color velocity vectors. By changing the linespec for eg. [1 1 0], it will give you yellow color.
  댓글 수: 1
Daniele Morandi
Daniele Morandi 2022년 11월 25일
Hi Priyanshu,
I guess that Bharathi meant that color could change depending on velocity magnitude, similarly to what happen in contour plot.
Colorbar should help reading magnitude related to color, if this is possible

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

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by