Question about a problem
Show older comments
I have a textfile which I've already unpacked into a vector.
Each value (units: lbs) in the textfile is a minute of fuel consumption of a airplane's flight. So as an example, the 50th value (let's the value is 325 lbs) is the 50th minute value, and the plane's total consumption from beginning of takeoff to 50th minute is 325 lbs.
Now here is the question being asked.
I am asked to find how long the takeoff portion of the flight lasts. The following is the information I am given.
I am told to use the first half of the dataset.
FirstHalf = A(1:length(A)/2,:)
Next, I have found the average total consumption rate (simply took the last value in the text file/divided by total minutes). I am told the average total consumption rate is 1.5 times the average rate at takeoff. So simple maths gives us AvgTakeoff = AvgTotal/1.5. Now I have the average takeoff rate (in units of lbs/min), but I need to find out how long does the takeoff last (in minutes)? Can i do this using For Loops or If statements?
2 Comments
Image Analyst
on 19 Oct 2018
This is inconsistent: "Each value (units: lbs) in the textfile is a minute of fuel consumption of a airplane's flight. So as an example, the 50th value (let's the value is 325 lbs) is the 50th minute value, and the plane's total consumption from beginning of takeoff to 50th minute is 325 lbs."
You said the value is the fuel consumption during that minute of flight. So the value at element 50 of 325 would mean that during minute #50, 325 lbs of fuel were used. But then you say that 325 means it was the "total consumption from beginning" of the flight. So, which is it? Consumption during only that minute, or total consumption since the flight started? You can't have it both ways.
FanOf23
on 19 Oct 2018
Answers (2)
Walter Roberson
on 18 Oct 2018
Edited: Walter Roberson
on 18 Oct 2018
0 votes
size() will tell you how many entries are in FirstHalf, which in turn will tell you how many minutes it lasted.
Or is the question about looking through the data to find the point at which FirstHalf >= AvgTakeoff ?
2 Comments
Walter Roberson
on 19 Oct 2018
diff() the total-fuel-used readings to figure out how much fuel was used in that minute. Find the first location where that is less than 1.5 times the average over the whole flight; that will be the minute at which the climb is already ended.
Image Analyst
on 19 Oct 2018
0 votes
Since part of the first half is take-off, you don't want to include that in the average fuel consumption. You want to take, like the average of the last 10% of first half, something like this
instantaneousFuelConsumption = diff(FirstHalf); index = 0.9 * length(instantaneousFuelConsumption); averageCruisingConsumption = mean(instantaneousFuelConsumption(index:end));
Now you need to find out which elements of instantaneousFuelConsumption are more than 1.5 times averageCruisingConsumption. Easy - give it a try.
2 Comments
FanOf23
on 20 Oct 2018
Image Analyst
on 20 Oct 2018
Yes, it could be, if you didn't want to use find() like a typical MATLAB programmer would.
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!