The following arithmetic operators are available and work on scalars and matrices.
x +
y
x .+
y
+
.
x -
y
x .-
y
-
.
x *
y
x .*
y
x /
y
(inverse (y') * x')'
but it is computed without forming the inverse of y'.
If the system is not square or if the coefficient matrix is singular,
a minimum norm solution is computed.
x ./
y
x \
y
inverse (x) * y
but it is computed without forming the inverse of x.
If the system is not square or if the coefficient matrix is singular,
a minimum norm solution is computed.
x .\
y
x ^
y
x **
y
The implementation of this operator needs to be improved.
x .^
y
x .**
y
-
x
+
x
x'
conj (x.')
x.'
Note that because Octave's element by element operators begin with a
.
there is a possible ambiguity for statements like
1./m
because the period could be interpreted either as part of the constant or as part of the operator. To resolve this conflict Octave treats the expression as if you had typed
(1) ./ m
and not
(1.) / m
Although this is inconsistent with the normal behavior of Octave's lexer which usually prefers to break the input into tokens by preferring the longest possible match at any given point it is more useful in this case.
warn_divide_by_zero | Built-in Variable |
If the value of warn_divide_by_zero is nonzero a warning
is issued when Octave encounters a division by zero. If the value is
0 the warning is omitted. The default value is 1.
|