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:
untitled.png
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:
altitude.JPG
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:
tk.JPG ld.JPG
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
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.
Alex LENFANT
Alex LENFANT 2019-4-14
Thks for the quick reply.
Here is mat file of the altitude.
Regards

请先登录,再进行评论。

采纳的回答

Walter Roberson
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()

更多回答(1 个)

Alex LENFANT
Alex LENFANT 2019-4-15
编辑:Alex LENFANT 2019-4-15
Thank you it works!
Here is the final result:

类别

Help CenterFile Exchange 中查找有关 Mapping Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by