Plot data from excel problem - Real flight data
2 次查看(过去 30 天)
显示 更早的评论
Hello the community,
I am facing a problem using Matlab for plotting data from excel sheet.
I am a private pilot and I used the Iphone app "Flight data reccorder" to reccord my flight yesterday. It sends me by mail a csv file with a lot if data like altitude, ground speed, longitude, etc...
I want to visualize in 3D my flight so I plotted the longitute, the lattitude and the altitude using plot3 after converting excel collumn into arrays.
Here is wat tI obtain:

As you can see on the upper side on the left there are some problems with the altitude at the begining and the end of the flight.
I checked the values of the altitude on my arrays and there is no problem the first value are about 300ft which was the altitude of the terrain.
When I plot pnly the alitude here is what it looks like:

The are problems at the boundaries as you can see. But the strange values in the plot don't appear in the array. Here are the first and last values int the array altitude:

On the lft we have the take off and on the right landing.
I don't understand why whenI plot it there are the points at the beginings and the end at about 3000ft....
Does any one have an idea??
Thks in advance
Regards from France
Alex
2 个评论
Walter Roberson
2019-4-14
Can you attach the data?
Is it possible that you are using something like a moving average to smooth the data before plotting it? Moving average can introduce odd values at the two ends.
采纳的回答
Walter Roberson
2019-4-14
Your data is not numeric. Your data is categorical. When you plot(), you are plotting the category code numbers, not the values associated with the categories. That might potentially be okay if the category codes corresponding to sequential category values that were separated by a constant value, but that is not the case.
In particular, the category names got created in sorted order by characters. As in '1007.0' sorts far earlier than '298.0' ...
I speculate that you used importdata() to read in the Excel file, and had categorical selected.
I recommend that you instead use detectImportOptions() and readtable()
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mapping Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
