MATLAB Answers

How to make a trajectory from position and Velocity data

8 views (last 30 days)
Adam Levschuk
Adam Levschuk on 16 Jun 2020
Commented: David Hill on 17 Jun 2020
Hello, I feel that this is a very easy question and i am mad that i have not figured it out myself.
I have position data (euler angles) and the coraspinding angualr velcoity and i want to generate a 2xn variable with both these variables.
if i do...
plot(eulerAngles(:,2), gyr(:,2)) this plot gives me the trajectory that i am trying to create. How do i save this trajectory as a single variable?
thanks for your help.

  0 Comments

Sign in to comment.

Accepted Answer

David Hill
David Hill on 17 Jun 2020
newVariable=[eulerAngles(:,2)';gyr(:,2)'];

  4 Comments

Show 1 older comment
David Hill
David Hill on 17 Jun 2020
If you look at the documentation for the plot() function, you cannot provide a matrix to it. You will need to do the following:
plot(newVariable(1,:),newVariable(2,:));%row 1 is eularAngles and row 2 is gyr
Adam Levschuk
Adam Levschuk on 17 Jun 2020
ohhhh i see, thank you very mcuh david. very helpful!
Adam
David Hill
David Hill on 17 Jun 2020
If you are satisfied with the answer, accept it to close it out.

Sign in to comment.

More Answers (0)

Products


Release

R2020a