Info

This question is closed. Reopen it to edit or answer.

Problem with Matlab program

2 views (last 30 days)
William Plummer
William Plummer on 16 Feb 2019
Closed: MATLAB Answer Bot on 20 Aug 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 Comments
Walter Roberson
Walter Roberson on 16 Feb 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 on 27 Feb 2019
Sorry for such a late reply but I figured it out. Thank you!

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!