<html lang="en"> <head> <title>Comma Separated Lists Generated from Structure Arrays - GNU Octave</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Octave"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Comma-Separated-Lists.html#Comma-Separated-Lists" title="Comma Separated Lists"> <link rel="prev" href="Comma-Separated-Lists-Generated-from-Cell-Arrays.html#Comma-Separated-Lists-Generated-from-Cell-Arrays" title="Comma Separated Lists Generated from Cell Arrays"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Comma-Separated-Lists-Generated-from-Structure-Arrays"></a> <p> Previous: <a rel="previous" accesskey="p" href="Comma-Separated-Lists-Generated-from-Cell-Arrays.html#Comma-Separated-Lists-Generated-from-Cell-Arrays">Comma Separated Lists Generated from Cell Arrays</a>, Up: <a rel="up" accesskey="u" href="Comma-Separated-Lists.html#Comma-Separated-Lists">Comma Separated Lists</a> <hr> </div> <h4 class="subsection">6.3.2 Comma Separated Lists Generated from Structure Arrays</h4> <p>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: <pre class="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); </pre> <!-- DO NOT EDIT! Generated automatically by munge-texi.pl. --> <!-- Copyright (C) 1996-2012 John W. Eaton --> <!-- This file is part of Octave. --> <!-- Octave is free software; you can redistribute it and/or modify it --> <!-- under the terms of the GNU General Public License as published by the --> <!-- Free Software Foundation; either version 3 of the License, or (at --> <!-- your option) any later version. --> <!-- Octave is distributed in the hope that it will be useful, but WITHOUT --> <!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or --> <!-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --> <!-- for more details. --> <!-- You should have received a copy of the GNU General Public License --> <!-- along with Octave; see the file COPYING. If not, see --> <!-- <http://www.gnu.org/licenses/>. --> </body></html>