I cant figure out how to make the plot show up
2 ビュー (過去 30 日間)
古いコメントを表示
Nevermind.
0 件のコメント
採用された回答
Star Strider
2019 年 11 月 30 日
Try this:
stage1BurnTimeStart=0;
stage2BurnTimeStart=165;
stage3BurnTimeStart=360;
stage3BurnTimeEnd=500;
tv = 6.5:stage3BurnTimeEnd;
rocketSpeed = zeros(size(tv));
for k = 1:numel(tv)
t = tv(k);
if t >= stage1BurnTimeStart & t < stage2BurnTimeStart
specificImpulse(k) = 263;
grossMass(k) = 2290000;
remainingMass(k) = 13000;
BurnTime(k)=165;
elseif t >= stage2BurnTimeStart & t < stage3BurnTimeStart
specificImpulse(k) = 421;
grossMass(k) = 496200;
remainingMass(k) = 40100;
BurnTime(k)=360;
elseif t >= stage3BurnTimeStart & t <= stage3BurnTimeEnd
specificImpulse(k) = 421;
grossMass(k) = 123000;
remainingMass(k) = 13500;
BurnTime(k)=500;
end
currentMass(k) = (grossMass(k))-((grossMass(k))-(remainingMass(k))).*t./BurnTime(k);
rocketSpeed(k) = 9.81.*specificImpulse(k).*log(grossMass(k)./(currentMass(k)))-(t);
end
figure(1)
plot(tv,rocketSpeed)
I believe this is essentially what you intended. There are still problems that need to be addressed, however the code runs and the plot shows up!
2 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!