How to plot streamline for velocity data??
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I need to plot velocity vectors along with streamline. For velocity vectors, I have used quiver() as shown below which works properly, please let me know how to plot streamlines.. I have attached velocity data for your reference.. Please help me with this..
skip=2;
ff=quiver(x',y(1:skip:end),Um(1:skip:end,:),Vm(1:skip:end,:));
0 commentaires
Réponses (2)
darova
le 16 Fév 2021
try this
clc,clear
[x,y,z] = peaks(20); % some data
[u,v] = gradient(z); % create direction vectors
t = linspace(0,2*pi,5);
[sx,sy] = pol2cart(t,2); % start position (circle)
h = streamline(x,y,u,v,sx,sy); % display streamlines
hold on
for i = 1:length(h) % loop through all streamlines
x1 = get(h(i),'xdata'); % get data
y1 = get(h(i),'ydata');
% u and v vector fields are known
u1 = interp2(x,y,u,x1,y1); % interpolate vector field at streamline position
v1 = interp2(x,y,v,x1,y1);
quiver(x1,y1,u1,v1)
end
hold off
0 commentaires
Voir également
Catégories
En savoir plus sur Vector Fields 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!