<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 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="colon" xml:lang="pt">
    <refnamediv>
        <refname>colon (:)</refname>
        <refpurpose>operador dois pontos</refpurpose>
    </refnamediv>
    <refsection>
        <title>Descrição</title>
        <para>
            Colon symbol <literal>:</literal> can be used to form implicit
            vectors. (see also <link linkend="linspace">linspace</link>, <link linkend="logspace">logspace</link>)
        </para>
        <variablelist>
            <varlistentry>
                <term>j:k</term>
                <listitem>
                    <para>
                        é o vetor <literal>[j, j+1,...,k]</literal> (vazio se
                        <literal>j&gt;k</literal>).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>j:d:k</term>
                <listitem>
                    <para>
                        é o vetor <literal>[j, j+d, ..., j+m*d] </literal>
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
        <para>A notação de dois pontos também pode ser usada para retirar linhas,
            colunas e elementos selecionados de vetores e matrizes (ver também
            <link linkend="extraction">extraction</link>,<link linkend="insertion">insertion</link>)
        </para>
        <variablelist>
            <varlistentry>
                <term>A(:)</term>
                <listitem>
                    <para>
                        é o vetor de todos os elementos de <literal>A</literal>
                        considerados como uma única coluna.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>A(:,j)</term>
                <listitem>
                    <para>
                        é a j-ésima coluna de <literal>A</literal>
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>A(j:k)</term>
                <listitem>
                    <para>
                        é <literal>[A(j),A(j+1),...,A(k)]</literal>
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>A(:,j:k)</term>
                <listitem>
                    <para>
                        é <literal>[A(:,j),A(:,j+1),...,A(:,k)] </literal>
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>A(:)=w</term>
                <listitem>
                    <para>
                        preenche a matriz <literal>A</literal> com entradas de
                        <literal>w</literal> (tomados coluna a coluna se
                        <literal>w</literal> é uma matriz).
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
       <note>
          <literal>type(:)</literal> is 129.
          <literal>typeof(:)</literal> is <literal>"implicitlist"</literal>.
       </note>
    </refsection>
    <refsection role="see also">
        <title>Ver Também</title>
        <simplelist type="inline">
            <member>
                <link linkend="dollar">dollar</link>
            </member>
            <member>
                <link linkend="extraction">extraction</link>
            </member>
            <member>
                <link linkend="matrix">matrix</link>
            </member>
            <member>
                <link linkend="linspace">linspace</link>
            </member>
            <member>
                <link linkend="logspace">logspace</link>
            </member>
        </simplelist>
    </refsection>
    <refsection role="history">
        <title>Histórico</title>
        <revhistory>
            <revision>
                <revnumber>6.0</revnumber>
                <revdescription>
                  <itemizedlist>
                    <listitem>
                        <literal>type(:)</literal> is 129 (as for <literal>1:$</literal>)
                        instead of 1. <literal>size(:)</literal> is undefined
                        (instead of <literal>[-1,-1]</literal>).
                    </listitem>
                    <listitem>
                        <literal>typeof(:)</literal> is now <literal>"implicitlist"</literal>,
                        like <literal>1:$</literal>.
                    </listitem>
                    <listitem>
                        <literal>%i:10</literal> now yields an error.
                    </listitem>
                  </itemizedlist>
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
