How to make a trajectory from position and Velocity data

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.

 Respuesta aceptada

newVariable=[eulerAngles(:,2)';gyr(:,2)'];

4 comentarios

Thanks for the reply david, i tried something simialr to this, but i do not understand the resulting outcome.
i understand that it is a row of position over velcoity vectors.
However, when i plot the newVariable i get a plot that looks like
newVariable=[eulerAngles(:,2)';gyr(:,2)']
what is this i am looking at here?
thanks for any advise.
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
ohhhh i see, thank you very mcuh david. very helpful!
Adam
If you are satisfied with the answer, accept it to close it out.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 16 de Jun. de 2020

Comentada:

el 17 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by