6.4.2从结构体数组生成的逗号分隔列表

结构体数组同样可以用于创建逗号分隔的列表。这是通过寻址structurearray的一个字段来完成的。例如

x = ceil (randn (10, 1));
in = struct ("call1", {x, 3, "last"},
             "call2", {x, inf, "first"});
out = struct ("call1", cell (2, 1), "call2", cell (2, 1));
[out.call1] = find (in.call1);
[out.call2] = find (in.call2);

版权所有 © 2024-2025 Octave中文网

ICP备案/许可证号:黑ICP备2024030411号-2