Question about a problem
显示 更早的评论
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 个评论
Image Analyst
2018-10-19
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
2018-10-19
回答(2 个)
Walter Roberson
2018-10-18
编辑:Walter Roberson
2018-10-18
0 个投票
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 个评论
Walter Roberson
2018-10-19
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
2018-10-19
0 个投票
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 个评论
FanOf23
2018-10-20
Image Analyst
2018-10-20
Yes, it could be, if you didn't want to use find() like a typical MATLAB programmer would.
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!