Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - 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 >> Scilab > Scilab palavra-chave > plus (+)

plus (+)

Adição numérica. Concatenação de texto (colagem)

Seqüência de Chamamento

X + Y
str1 + str2

Parâmetros

X, Y

escalares, vetores, matrizes ou hipermatrizes de booleanos, números, polinômios ou racionais. Eles também podem ser syslin listas.

str1, str2

dois textos, vetores, matrizes, ou hipermatrizes de textos.

Descrição

Para operandos numéricos, a adição tem seu significado usual.

Adding booleans together or to numbers of integer, decimal or complex type performs the implicit conversions %F => 0 and %T => 1 before processing. The result has the type of the input numbers, or is decimal for booleans added together.

Para dois textos, + concatena (cola) os dois juntos.

Se um operando é um array e o outro é um escalar, o escalar é aplicado (adicionado ou colado) a cada componente da matriz.

Se um operando é a matriz vazia [], o resultado é [].

O operador de adição pode ser estendido para outros tipos de dados atravès overloading.

Examplos

[1, 2] + 1
[] + 2
%s + 2
1/%s + %s
"con" + ["catenate" "crete" "sole"]
--> [1, 2] + 1
 ans  =
   2.   3.

--> [] + 2
 ans  =
    []

--> %s + 2
 ans  =
   2 +s

--> 1/%s + %s
 ans  =
        2
   1 + s
   ------
     s

--> "con" + ["catenate" "crete" "sole"]
 ans  =
!concatenate  concrete  console  !

Com booleanos :

[%f %f %t %t] + [%f %t %f %t]
%f + [-1 0 2 %i]
%t + [-1 0 2 %i]
--> [%f %f %t %t] + [%f %t %f %t]
 ans  =
   0.   1.   1.   2.

--> %f + [-1 0 2 %i]
 ans  =
  -1.   0.   2.   i

--> %t + [-1 0 2 %i]
 ans  =
   0.   1.   3.   1. + i

Ver Também

  • minus — (-) operador de subtração, mudança de sinal
  • operators — nomes dos operadores Scilab
  • overloading — capacidades de overloading ("sobrecarga") de exibições, funções e operadores
  • oldEmptyBehaviour — Controls the operation+ and operation- behaviour for Scilab
  • mtlb_a — Matlab addition emulation function

Histórico

VersionDescription
6.0.0 A + [] now returns [] instead of A
Report an issue
<< parentheses Scilab palavra-chave quote >>

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:
Tue Feb 25 08:52:27 CET 2020