Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Problem with Matlab program

1 vue (au cours des 30 derniers jours)
William Plummer
William Plummer le 16 Fév 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
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 commentaires
Walter Roberson
Walter Roberson le 16 Fév 2019
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 .
William Plummer
William Plummer le 27 Fév 2019
Sorry for such a late reply but I figured it out. Thank you!

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by