Custom Flight Log - change datatype
2 次查看(过去 30 天)
显示 更早的评论
i have one problem with the "Custom Flight Log" example.
after loading the data from a file:
Data = load('xxx.mat');
logData = Data;
Plotter = flightLogSignalMapping;
I need to make the timeAccess function. But inside my Data struct is a time array from the type double (The data is saved as milliseconds)
timeAccess = @(x)x.time;
How can i change the double type to milliseconds type ?
The problem is the data is should not be changed, because it has the right structure (0.0083).
And the fuction:
MS = milliseconds(X)
would change the data.
So how i change only the format to milliseconds ?
i am happy for any help
0 个评论
回答(2 个)
Jianxin Sun
2021-2-23
Hi Antoine,
Is your data X == 0.0083 seconds or 0.0083 milliseconds? If it is the former, you can use
timeAccess = @(x)seconds(x.time);
The custom flight log expects a duration type from timeAccess return and the function above converts double type to a duration, such as 0.0083 seconds (8.3 ms).
Thanks,
Jianxin.
0 个评论
Antoine Dilly
2021-2-23
2 个评论
Jianxin Sun
2021-2-23
Hi Antoine,
For a GPS signal, we are expecting 6 elements when extracting its data:
"GPS#" "Latitude, Longitude, Altitude, GroundSpeed, CourseAngle, SatellitesVisible"
You can see the information above using
info(customPlotter, "Signal", "GPS#")
When you create the GPS function handle, consider fills the fields you don't have with zeros
GPS = @(x)[x.lat, x.lon, x.alt, zeros(size(x.lat, 1), 3)]
Thanks,
Jianxin
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!