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 The length of an array M of cells or of structures is the number of elements of the array.
59 It is equivalent to <literal>size(M, "*")</literal>.
62 <literal>length('123')</literal> é <literal>3</literal>.
63 <literal>length([1,2;3,4])</literal> is <literal>4</literal>.
65 <para>AVISO : length para matrizes esparsas retorna o máximo das
66 dimensões, não o produto das dimensões. (exemplo :
67 length(sparse(eye(12,2))) retorna max(12,2), não 24)
69 <para>Utilize size(...,'*') para matrizes esparsas.</para>
72 <title>Exemplos</title>
73 <programlisting role="example"><![CDATA[
75 length(['olá mundo',SCI])
79 <title>Ver Também</title>
80 <simplelist type="inline">
82 <link linkend="size">size</link>
87 <title>History</title>
90 <revnumber>5.4.0</revnumber>
92 This function allows overloading for mlist type.
96 <revnumber>6.0.0</revnumber>
100 The <literal>length()</literal> of any array C of cells was formerly
101 always 3, whatever are the number of dimensions and the sizes of the
102 array. It is now the number of elements of the array at null depth
103 (without recursive counting), equal to <literal>size(C, "*")</literal>.
106 The <literal>length()</literal> of any array S of structures was formerly
107 equal to its number of fields +2, whatever are the number of dimensions
108 and the sizes of the array. It is now the number of elements of the
109 array at null depth, equal to <literal>size(S, "*")</literal>.