Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Cadeias de Caracteres (Strings) > length

length

Número de caracteres de um texto. Número de elementos de uma matriz ou lista.

Seqüência de Chamamento

n=length(M)

Parâmetros

M

matriz (usual ou de polinômios ou de strings) ou lista

n

inteiro ou matriz de inteiros

Descrição

Para uma matriz usual ou de polinômios, n é o inteiro igual ao número de linhas vezes o número de colunas de M. (Também válido para M uma matriz de booleanos)

Para matrizes de strings (e, em particular, para um string) length retorna em n os comprimentos das entradas da matriz de strings M.

O comprimento de uma lista é o número de elementos da lista (também dado por size).

The length of an array M of cells or of structures is the number of elements of the array. It is equivalent to size(M, "*").

length('123') é 3. length([1,2;3,4]) is 4.

AVISO : length para matrizes esparsas retorna o máximo das dimensões, não o produto das dimensões. (exemplo : length(sparse(eye(12,2))) retorna max(12,2), não 24)

Utilize size(...,'*') para matrizes esparsas.

Exemplos

length([123 ; 456 ])
length(['olá mundo',SCI])

Ver Também

History

VersãoDescrição
5.4.0 This function allows overloading for mlist type.
6.0.0
  • The length() of any array C of cells was formerly always 3, whatever are the number of dimensions and the sizes of the array. It is now the number of elements of the array at null depth (without recursive counting), equal to size(C, "*").
  • The length() of any array S of structures was formerly equal to its number of fields +2, whatever are the number of dimensions and the sizes of the array. It is now the number of elements of the array at null depth, equal to size(S, "*").
Report an issue
<< justify Cadeias de Caracteres (Strings) part >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:35:26 CET 2022