<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
          xmlns:scilab="http://www.scilab.org" xml:id="zeros" xml:lang="en">
    <refnamediv>
        <refname>zeros</refname>
        <refpurpose>null matrix</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>y=zeros(m1,m2,...)
            y=zeros(x)
            y=zeros()
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>x,y</term>
                <listitem>
                    <para>matrices</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>m1, m2,..</term>
                <listitem>
                    <para>integers</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>type</term>
                <listitem>
                    <para>optional character string: 'double', 'boolean','int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', or 'uint64'.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>Returns a null matrix.  By default the returned matrix is of double precision floating point type but a given type can be precised in the <term>type</term> argument.</para>
        <variablelist>
            <varlistentry>
                <term>zeros(m1,m2,..,mn)</term>
                <listitem>
                    <para>
                        creates a <literal>(m1,m2,..,mn)</literal> null matrix.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>zeros(m1,m2,..,mn,type)</term>
                <listitem>
                    <para>
                        returns a <literal>(m1,m2,..,mn)</literal> null matrix with type given by <literal>type</literal>. In the case of boolean type the matrix is filled with <literal>%F</literal> value. 
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>zeros(x)</term>
                <listitem>
                    <para>returns a null matrix with the same size as
                        <literal>x</literal>.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>zeros(m1,m2,..,mn,type)</term>
                <listitem>
                    <para>
                        returns a null matrix with the same size as <literal>x</literal>
                        and type given by <literal>type</literal>. In the case of boolean type the matrix is filled with <literal>%F</literal> value. 
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>zeros(x)</term>
                <listitem>
                    <para>
                        is also valid for <literal>x</literal> a
                        <literal>syslin</literal> list.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Remarks</title>
        <itemizedlist>
            <listitem>
                <para>
                    Note that <literal>zeros(3)</literal> is <literal>zeros(a)</literal>
                    with <literal>a=3</literal> i.e it is NOT a 3x3 matrix!
                </para>
            </listitem>
            <listitem>
                <para>zeros() is equivalent to zeros(1,1).</para>
            </listitem>
            <listitem>
                <para>
                    <literal>zeros(3,-3)</literal> and <literal>zeros(-3,-3)</literal> both return an empty matrix.
                </para>
            </listitem>
        </itemizedlist>
        <note>
           <literal>repmat(1, sizes)</literal> can be used to generate an array of zeros with
           <literal>sizes=[m1 m2 ..]</literal> given as a vector.
        </note>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
zeros(3)
zeros(3,3)
zeros(3,3,"uint8")
zeros(3,3,"boolean")
zeros(2,3,2)

repmat(1, [2 4 2])
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="eye">eye</link>
            </member>
            <member>
                <link linkend="ones">ones</link>
            </member>
            <member>
                <link linkend="repmat">repmat</link>
            </member>
            <member>
                <link linkend="signed_zero">-0</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
