I have a code which i read a gpx file and obtain the values of Latitude, Longitude and Elevation in matrix A.
route = gpxread('Patrulha_Quinta_das_Lameirinhas_relogio.gpx');
A=[route.Latitude;route.Longitude;route.Elevation];
Then i made a filter to consider the consecutive 10 to 10 seconds. This was to remove possible outliers.
in my project i want to study the behaviour of velocity with different types of terrain and different intervals of slope.
Distance, velocity and slope were calculated by this for cicle
deltaLat(i,:)=(B(i+1,1)-B(i,1))*60*1852;
deltaLon(i,:)=(B(i+1,2)-B(i,2))*60*1852;
deltaZ(i,:)=B(i+1,3)-B(i,3);
distancia=sqrt(x.^2+y.^2+z.^2);
velocidade_media=sum(distancia)/length(A);
declive=(z./distancia)*100;
Then i organized my data velocidade(velocity) and declive(slope) data in 4 intervals of slope: >10%, 0-10%, -10% - 0%, < -10% in oder to calculate the mean of velocity in each interval of slope.
v_mean_10_plus= mean(velocidade(declive > 10));
v_mean_0_10 = mean(velocidade(declive <= 10 & declive >= 0));
v_mean_10_0 = mean(velocidade(declive < 0 & declive >= -10));
v_mean_10_minus = mean(velocidade(declive < -10));
dec_0_plus=declive(declive>=0);
dec_0_minor=declive(declive<0);
vel_0_plusP=velocidade(declive>=0);
vel_0_minor=velocidade(declive<0);
My question is how can I treat my raw data in order to get to a semehant version of Tobler's Hiking Function (exponential model) (Figure below). I've tried a few options like polyfit, fit, but it doesnt work for my project.
I appreciate your consideration.