Previous: , Up: Comma Separated Lists   [Contents][Index]


6.3.2 Comma Separated Lists Generated from Structure Arrays

Structure arrays can equally be used to create comma separated lists. This is done by addressing one of the fields of a structure array. For example:

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);