Add

Adds two variables. It returns the sum of x and y. It is performed element-wise if the arguments are vectors, matrices or signals. Inputs must be of the same size and the same type unless one is a scalar. You can add a scalar value to any other type.

Syntax

x+y

Types
 Variable NameValue TypeVariable Type
Arguments:xreal, complexscalar, vector, matrix, signal, xy-data
yreal, complexscalar, vector, matrix, signal, xy-data
Result: z real, complex scalar, vector, matrix, signal, xy-data
Calculator Input

Use the + button to create the operation.

Examples

Add Scalar to Scalar

IDDescriptionTypeValueExpression
xArgumentREAL22
yArgumentREAL33
z Result REAL 5x+y

Add Scalar to Vector

IDDescriptionTypeValueExpression
xArgumentREAL VECTOR

[2, 2.5]
yArgumentREAL33
z Result REAL VECTOR

x+y

Add Vector to Vector (Same Size)

IDDescriptionTypeValueExpression
xArgumentREAL VECTOR

[2, 2.5]
yArgumentREAL VECTOR

[3, 3.5]
z Result REAL VECTOR

x+y

Add Scalar to Matrix

IDDescriptionTypeValueExpression
xArgumentREAL MATRIX

[[2, 2.5, 3],[3.5, 4, 4.5]]
yArgumentREAL33
z Result REAL MATRIX

x+y

Add Matrix to Matrix (Same Size)

IDDescriptionTypeValueExpression
xArgumentREAL MATRIX

[[2, 2.5],[1, 1]]
yArgumentREAL MATRIX

[[1, 1],[3, 3.5]]
z Result REAL MATRIX

x+y

Add Scalar to Signal

IDDescriptionTypeValueExpression
xArgumentREAL SIGNAL   signal([0, 0.5, 1],[1, 2, 3])
yArgumentREAL11
z Result REAL SIGNAL   x+y

Add Signal to Signal (Same Size)

IDDescriptionTypeValueExpression
xArgumentREAL SIGNAL   signal([0, 0.5, 1],[1, 2, 3])
yArgumentREAL SIGNAL   signal([0, 0.5, 1],[2, 3, 4])
z Result REAL SIGNAL   x+y

Add Signal to Signal (Different Size)

IDDescriptionTypeValueExpression
xArgumentREAL SIGNAL   signal([0, 0.5, 1],[1, 2, 3])
yArgumentREAL SIGNAL   signal([0, 0.25, 0.5, 1],[2, 3, 4, 5])
z Result REAL SIGNAL   x+y

If the axes of abscissae are different, the signal is interpolated to the additional abscissa values by linear interpolation.