[x,y] = meshgrid(0:0.1:5,0:0.1:5);
alpha =10;
U=1;
startx = 0.1:0.1:5;
starty = ones(size(startx));
for i =1:length(x)
for j=1:length(y)
U=U+1;
u(x,y)=U*cos(alpha*(pi/180));
v(x,y)=U*sin(alpha*(pi/180));
quiver(x,y,u,v)
streamline(x,y,u,v, startx, starty)
end
end

 採用された回答

VBBV
VBBV 2022 年 11 月 14 日

0 投票

[x,y] = meshgrid(0:0.1:5,0:0.1:5);
alpha =10;
U=1;
startx = 0.1:0.1:5;
starty = ones(size(startx));
for i =1:length(x)
for j=1:length(y)
U=U+1;
u(i,j)=U*cos(alpha*(pi/180)); % use for loop indices
v(i,j)=U*sin(alpha*(pi/180));
end
end
figure
quiver(x,y,u,v)
use for loop indices

1 件のコメント

Muhamed Ehab
Muhamed Ehab 2022 年 11 月 14 日
thank's alot

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

リリース

R2016a

タグ

質問済み:

2022 年 11 月 14 日

編集済み:

2022 年 11 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by