I'm using the pathlength function to calculate some average changes in my data, but this does not take into account that -180 degrees = 180 degrees (ofcourse it doesn't do this as it's not programmed for that). So, my question is: How to make sure the pathlenght is calculated correctly.
Data_1=[1 0; 2 1]; % [time, roll] The path length function gives me "1", as we've moved 1 degree.
Now we move 1 degree but then in the -180 to 179 range.
data_2=[1 -180; 2 179]; %[time, roll]
The path length function tells me the change is 359 instead of 1 degree.