This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Addition, subtraction, multiplication, division, power, rounding


uplusUnary plus
uminusUnary minus
timesElement-wise multiplication
rdivideRight array division
ldivideLeft array division
powerElement-wise power
mtimesMatrix Multiplication
mrdivideSolve systems of linear equations xA = B for x
mldivideSolve systems of linear equations Ax = B for x
mpowerMatrix power
cumprodCumulative product
cumsumCumulative sum
diffDifferences and Approximate Derivatives
movsumMoving sum
prodProduct of array elements
sumSum of array elements
ceilRound toward positive infinity
fixRound toward zero
floorRound toward negative infinity
idivideInteger division with rounding option
modRemainder after division (modulo operation)
remRemainder after division
roundRound to nearest decimal or integer
bsxfunApply element-wise operation to two arrays with implicit expansion enabled


Array vs. Matrix Operations

Matrix operations follow the rules of linear algebra, and array operations execute element by element operations and support multidimensional arrays. The period character (.) distinguishes the array operations from the matrix operations.

Compatible Array Sizes for Basic Operations

Most binary operators and functions in MATLAB® support numeric arrays that have compatible sizes. Two inputs have compatible sizes if, for every dimension, the dimension sizes of the inputs are either the same or one of them is 1.

Operator Precedence

Precedence rules determine the order in which MATLAB evaluates an expression.

Floating-Point Numbers

MATLAB represents floating-point numbers in either double-precision or single-precision format. The default is double precision.


MATLAB supports 1-, 2-, 4-, and 8-byte storage for integer data. If you use the smallest integer type that accommodates your data, you can save memory and program execution time.