How to plot velocity component

6 visualizaciones (últimos 30 días)
Yashika
Yashika el 22 de Ag. de 2020
Comentada: KSSV el 25 de Ag. de 2020
Hello All,
Can I plot y- velocity component in matlab I I have u,v and mesh? How?
Yashika

Respuesta aceptada

KSSV
KSSV el 22 de Ag. de 2020
  5 comentarios
KSSV
KSSV el 22 de Ag. de 2020
For that you can make one zero matrix of same size as X/Y/u/v and use quiver.
Let X , Y, u, v be your matrices.
O = zeros(size(X)) ;
% x-components
figure
quiver(X,Y,u,O) ;
% y-components
figure
quiver(X,Y,O,v)
Yashika
Yashika el 22 de Ag. de 2020
Thank you so much for the trick.

Iniciar sesión para comentar.

Más respuestas (1)

Yashika
Yashika el 25 de Ag. de 2020
Hello KSSV,
I have one more question, how do I plot velocity interface on the top of quiver? I tried for contour but it say I need to have square matrix for the same. I have columns for xdata, ydata, Vx and Vy. I am attaching picture for the referance. I need to plot black line on each set of blue quivers out off this. I tried plot(x,Vx) it didn't plot single black curve for single set of blue arrow.
Yashika
  1 comentario
KSSV
KSSV el 25 de Ag. de 2020
n = 10 ;
x = zeros(n,1) ;
y = (1:n)' ;
u = rand(n,1) ;
v = zeros(n,1) ;
h = quiver(x,y,u,v,'scale',0) ;
hold on
plot(u,y,'b')
You need to play around with scale.

Iniciar sesión para comentar.

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by