Subtracts two variables. It returns the difference 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 the second variable is a scalar.
Syntax
x-y
Types
Variable Name | Value Type | Variable Type | ||
---|---|---|---|---|
Arguments: | x | real, complex | scalar, vector, matrix, signal, xy-data | |
y | real, complex | scalar, vector, matrix, signal, xy-data | ||
Result: | z | real, complex | scalar, vector, matrix, signal, xy-data |
Calculator Input
Use the
button to complete the operation.Examples
Subtract Scalar from Scalar
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL | 2 | 2 | |
y | Argument | REAL | 3 | 3 | |
z | Result | REAL | -1 | x-y |
Subtract Scalar from Vector
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL VECTOR |
| [2, 2.5] | |
y | Argument | REAL | 3 | 3 | |
z | Result | REAL VECTOR |
| x-y |
Subtract Vector from Vector (Same Size)
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL VECTOR |
| [2, 2.5] | |
y | Argument | REAL VECTOR |
| [3, 3.5] | |
z | Result | REAL VECTOR |
| x-y |
Subtract Scalar from Matrix
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL MATRIX |
| [[2, 2.5, 3],[3.5, 4, 4.5]] | |
y | Argument | REAL | 1 | 1 | |
z | Result | REAL MATRIX |
| x-y |
Subtract Matrix from Matrix (Same Size)
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL MATRIX |
| [[2, 2.5],[1, 1]] | |
y | Argument | REAL MATRIX |
| [[1, 1],[3, 3.5]] | |
z | Result | REAL MATRIX |
| x-y |
Subtract Scalar from Signal
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL SIGNAL | signal([0, 0.5, 1],[1, 2, 3]) | ||
y | Argument | REAL | 1 | 1 | |
z | Result | REAL SIGNAL | x-y |
Subtract Signal from Signal (Same Size)
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL SIGNAL | signal([0, 0.5, 1],[1, 2, 3]) | ||
y | Argument | REAL SIGNAL | signal([0, 0.5, 1],[2, 3, 4]) | ||
z | Result | REAL SIGNAL | x-y |
Subtract Signal from Signal (Different Size)
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL SIGNAL | signal([0, 0.5, 1],[1, 2, 3]) | ||
y | Argument | REAL 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.