Info
此问题已关闭。 请重新打开它进行编辑或回答。
Problem with Matlab program
1 次查看(过去 30 天)
显示 更早的评论
Im having some issues with my program, Im trying to compute the ideal-line-of-sight angle for a problem but I cant input my Distance or time. I was working on this same issue earlier today and there was not a problem (although I was using a earlier edition of Matlab). This is what I have for my script so far:
clear
clc
%% Part A
disp('Food delievery requirements')
a=input('what is the horizontal speed in mph?');
b=input('what is the altitude of the airplane in meters?');
time=sqrt(b/4.9);
fprintf('%2.2\t',time);
disp('seconds')
%% Part B
v=a.*.44704;
Distance=(v.*time)+(1/2.*0.*time^2);
fprintf('%3.2\t', Distance)
disp('meters')
The formula that im using won't display any numbers in this edition. I also plan on using whatever numbers that result from the input to place into an inverse tangent function to get the line- of- sight angle. Will this work or is there a better method that I can use?
3 个评论
Walter Roberson
2019-2-16
your a variable looks like either thrust rate or fuel supply. Thrust has to be divided by current mass to get acceleration and current mass decreases as fuel is burned (so acceleration increases because the object is getting lighter . ) Your code does not appear to take mass into account .
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!