How to plot a GPS track with vertical (z-axis) accelerations at specific points?

5 次查看(过去 30 天)
I have a table of GPS coordinates and three-axis acceleration data. For context, I am trying to plot the GPS plot as a scatter plot (currently using geoscatter), but have the points vary in color based on an acceleration threshold for the z axis at each point. This will identify the track and exact points at which the object executed vertical movement. Here is my current code. The data is in a comma separated text file with columns: TIME, DATE, LATITUDE, LONGITUDE, ALTITUDE, XACCELERATION, YACCELERATION, ZACCELERATION.
I believe the issue is that multiple GPS stamps occur at the same coordinates so any value that surpasses the threshold is overwritten by values that do not and so the plot is all one color. My priority is ensuring that the points with max acceleration values get plotted. The mean acceleration is about 0.17 with the max absolute value being between 20 and 30. How can I make it so the entire track is plot but the max acceleration values are red? Thanks in advance for any help.
clear all
close all
A=readtable('Data.txt');
figure
geoplot(A.LATITUDE, A.LONGITUDE)
figure
geoscatter(A.LATITUDE, A.LONGITUDE);
%Define thesholds
thresholds = [10];
% Assign color
C = zeros(length(A.ZACCELERATION),3);
C(abs(A.ZACCELERATION) < thresholds,3) = 1; %blue
C(abs(A.ZACCELERATION) > thresholds,1) = 1; %red
% your code, slightly adapted
pointsize = 10;
figure
scatter(A.LATITUDE, A.LONGITUDE,pointsize,C);
% Create colorbar
colormap([0 0 1;0 0 0;1 0 0])
chb = colorbar();
caxis([0,1])
set(chb,'Ticks',0.1667:0.3334:1,'TickLabels',{'Z accel < 10', '', 'Z accel > 10'})

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by