将struct数组的字段提取到新数组

Fan*_*Fox 9 matlab struct vector

我有一个结构,有2个字段:timepose.我有一个在数组中组成的这个结构的多个实例,所以这个例子是:

poses(1)
    -time = 1
    -pose = (doesn't Matter)
poses(2)
    -time = 2
    -pose = (doesn't Matter)
poses(3)
    -time = 3
    -pose = (doesn't Matter)
...
Run Code Online (Sandbox Code Playgroud)

现在当我打印这个:

 poses.time
Run Code Online (Sandbox Code Playgroud)

我明白了:

ans =
      1
ans =
      2
ans =
      3
Run Code Online (Sandbox Code Playgroud)

如何获取输出并将其放入向量中?

Gun*_*uyf 16

使用括号:

timevec=[poses.time];
Run Code Online (Sandbox Code Playgroud)

棘手的matlab,我知道我知道,如果你正在使用结构,你只需要记住这个;)