フィルターのクリア

Help with plotting multiple angles/velocties

2 ビュー (過去 30 日間)
Taylor Gates
Taylor Gates 2018 年 7 月 11 日
回答済み: KSSV 2018 年 7 月 11 日
I am trying to generate multiple lines on a graph corresponding to velocities and launch angles. heres my basic code but how I do get it to loop with a single velocity but multiple launch angles?
thetaList=[0, .17453293 .52359878 .78539816 1.04719755 1.57079633];
for i = 1:length(thetaList)
theta=thetaList(i);
end
hold on
g= 9.81;
v0=[5]
tf=2.*v0.*sin(theta)/g;
t=0:0.01:tf;
x=v0*cos(theta)*t;
y=v0*sin(theta).*t - 0.5*g*t.^2;
plot(x,y)

採用された回答

KSSV
KSSV 2018 年 7 月 11 日
thetaList=[0, .17453293 .52359878 .78539816 1.04719755 1.57079633];
figure
hold on
for i = 1:length(thetaList)
theta=thetaList(i);
g= 9.81;
v0= 5 ;
tf=2.*v0.*sin(theta)/g;
t=0:0.01:tf;
x=v0*cos(theta)*t;
y=v0*sin(theta).*t - 0.5*g*t.^2;
plot(x,y)
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by