数値の加算。 テキストの連結(グループ化)
X + Y str1 + str2
数値,多項式または有理数のスカラーまたはベクトルまたは行列.
syslin リストとすることも可能
2つのテキスト、ベクトル、またはテキストの行列。
数値オペランドの場合、加算は通常の意味を持ちます。
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.
2つのテキストの場合、+はそれらを連結します(glues)。
オペランドが配列であり、もう一方がスカラーの場合、スカラーが適用されます アレイの各構成要素に追加(接着または接着)される。
オペランドが空の行列[]である場合、結果は[]です。
加算演算子は、他のデータ型に拡張することができます (overloading).
--> [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 !
With booleans:
--> [%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
| Version | Description |
| 6.0.0 | A + [] now returns [] instead of
A |