+=, -=, *=, /=

These are compound assignment forms of the ordinary arithmetic operators.

Syntax

x += y
x -= y
x *= y
x /= y

Equivalent Expressions

x = x + y
x = x - y
x = x * y
x = x / y

Operands and Result

Allowed types: SCAL, VCT, AUD, TEXT, TSEQ, NUL
Not allowed: CLASS, CELL

xyx becomes
NULallowed typethat type
SCALallowed typethat type
VCTVCTVCT
AUDVCTAUD
VCTAUDAUD
TSEQVCTTSEQ
TSEQAUDnot allowed
AUDTSEQAUD

Notes

Examples

AUX> x=rand(5)
x =
0.5853 0.2218 0.6290 0.1231 0.2736

AUX> x*=10
x =
5.8531 2.2182 6.2896 1.2313 2.7363
AUX> x=tone(500,100).hann@-20
x =
audio (0.0ms~100.0ms)

AUX> y=noise(10)@-10>>40
y =
audio (40.0ms~50.0ms)

AUX> x += y
x =
audio (0.0ms~100.0ms)

Compound arithmetic example 1

Compound arithmetic example 2

Current source basis: