I have a structure that has 2 fields: time and pose . I have several instances of this structure consisting of an array, so an example of this:
time
pose
poses(1) -time = 1 -pose = (doesn't Matter) poses(2) -time = 2 -pose = (doesn't Matter) poses(3) -time = 3 -pose = (doesn't Matter) ...
Now when I type this:
poses.time
I get this:
ans = 1 ans = 2 ans = 3
How can I take this conclusion and put it in a vector?
Use brackets:
timevec=[poses.time];
complex matlab, I know that I know, you just need to remember this if you are working with structs;)
In cases where the field values ββare vectors (of the same size), and you need the result in the form of a matrix:
posmat = cell2mat({poses.pose}');
Returns each pose vector in a different posmat line.
posmat