1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 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: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="length" xml:lang="pt">
18 <refname>length</refname>
19 <refpurpose>comprimento de um objeto</refpurpose>
22 <title>Seqüência de Chamamento</title>
23 <synopsis>n=length(M)</synopsis>
26 <title>Parâmetros</title>
31 <para>matriz (usual ou de polinômios ou de strings) ou lista</para>
37 <para>inteiro ou matriz de inteiros</para>
43 <title>Descrição</title>
45 Para uma matriz usual ou de polinômios, <literal>n</literal> é o
46 inteiro igual ao número de linhas vezes o número de colunas de
47 <literal>M</literal>. (Também válido para <literal>M</literal> uma matriz
50 <para>Para matrizes de strings (e, em particular, para um string)
51 <literal>length</literal> retorna em <literal>n</literal> os comprimentos
52 das entradas da matriz de strings <literal>M</literal>.
54 <para>O comprimento de uma lista é o número de elementos da lista (também
55 dado por <literal>size</literal>).
58 <literal>length('123')</literal> é <literal>3</literal>.
59 <literal>length([1,2;3,4])</literal> is <literal>4</literal>.
61 <para>AVISO : length para matrizes esparsas retorna o máximo das
62 dimensões, não o produto das dimensões. (exemplo :
63 length(sparse(eye(12,2))) retorna max(12,2), não 24)
65 <para>Utilize size(...,'*') para matrizes esparsas.</para>
68 <title>Exemplos</title>
69 <programlisting role="example"><![CDATA[
71 length(['olá mundo',SCI])
75 <title>Ver Também</title>
76 <simplelist type="inline">
78 <link linkend="size">size</link>