1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2006-2008 - INRIA
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="setfield">
18 <refname>setfield</refname>
19 <refpurpose>list field insertion</refpurpose>
23 <synopsis>a = setfield(i, x, l)</synopsis>
26 <title>Arguments</title>
31 <para>a matrix of any possible types.</para>
38 a <literal>list</literal>, <literal>tlist</literal> or <literal>mlist</literal> variable.
46 a field index, see <link linkend="insertion">insertion</link> for more details.
61 <title>Description</title>
63 This function is an equivalent of <code>l(i)=x</code> syntax for field
64 extraction with the only difference that it also applies to
65 <literal>mlist</literal> objects.
69 <title>Examples</title>
70 <programlisting role="example"><![CDATA[
74 l(6)=['one more';'added']
75 l=setfield(5,"added by setfield", l)
78 <refsection role="see also">
79 <title>See also</title>
80 <simplelist type="inline">
82 <link linkend="insertion">insertion</link>
87 <title>History</title>
90 <revnumber>6.0.0</revnumber>
92 setfield returns variable updated instead of change it "in place".