小编M.P*_*til的帖子

从结构的多个字段中提取行

创建列向量(100行)的结构(25个字段).如何提取其特定行.例如,

s.a=[1 2 3 4 5 6]'
s.b=[5 2 8 1 0 4]'
s.c=[9 7 0 1 3 5]'
% 2 to 4 rows to be extracted
% expected output
t.a=[2 3 4]'
t.b=[2 8 1]'
t.c=[7 0 1]'
Run Code Online (Sandbox Code Playgroud)

对struct的索引不起作用.什么是通用的方式.

indexing matlab struct reference cell-array

3
推荐指数
1
解决办法
368
查看次数

标签 统计

cell-array ×1

indexing ×1

matlab ×1

reference ×1

struct ×1