Plot data from excel problem - Real flight data

조회 수: 2 (최근 30일)
Alex LENFANT
Alex LENFANT 2019년 4월 14일
편집: Alex LENFANT 2019년 4월 15일
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