Language Fundamentals > Operators and Elementary Operations

62 functions in MATLAB › Language Fundamentals > Operators and Elementary Operations.

Logical (Boolean) Operations

&Element-wise logical AND operator.
allTests whether all elements are nonzero (true).
anyTests whether any element is nonzero (true).
findFinds the indices of nonzero elements.
logicalConverts values to logical true or false.
Short-Circuit &&Short-circuit logical AND: the second operand is evaluated only if needed.
Short-Circuit ||Short-circuit logical OR: the second operand is evaluated only if needed.
xorLogical exclusive OR.
|Element-wise logical OR operator.
~Logical NOT operator.

Arithmetic Operations

'Complex conjugate transpose operator.
*Matrix multiplication operator.
+Addition operator: adds numbers, arrays and other values element by element.
-Subtraction and negation operator.
.'Transpose operator without conjugation.
.*Element-wise multiplication operator.
./Element-wise right division operator.
.\Element-wise left division operator.
.^Element-wise power operator.
/Right division operator: a / b divides, or solves x*B = A for matrices.
\Left division operator: solves the linear system A*x = B.
^Matrix power operator.
bsxfunApplies a binary function with implicit expansion of singleton dimensions.
ceilRounds toward positive infinity.
cumprodCumulative product of array elements.
cumsumCumulative sum of array elements.
diffDifferences between adjacent elements.
fixRounds toward zero, discarding the fractional part.
floorRounds toward negative infinity.
idivideInteger division with a chosen rounding rule.
modRemainder after division, with the sign of the divisor (modulo).
movsumMoving sum over a sliding window.
pagectransposeConjugate-transposes each page of an N-D array.
pagemldivideSolves linear systems page by page, A \ B for each page.
pagemrdivideRight division page by page, A / B for each page.
pagemtimesMatrix multiplication page by page for N-D arrays.
pagetransposeTransposes each page of an N-D array.
prodProduct of array elements.
remRemainder after division, with the sign of the dividend.
roundRounds to the nearest integer, or to a given number of digits.
tensorprodTensor product and contraction of arrays along chosen dimensions.
uminusUnary minus: changes the sign of each element.
uplusUnary plus: returns its argument, with the numeric conversion of an operation.

Relational Operations

<Less-than operator: tests element by element whether A is smaller than B.
<=Less-than-or-equal operator: tests element by element whether A is at most B.
==Equality operator: tests element by element whether A and B are equal.
>Greater-than operator: tests element by element whether A is larger than B.
>=Greater-than-or-equal operator: tests element by element whether A is at least B.
isequalTests whether arrays are equal in size and content.
isequalnTests array equality, treating NaN values as equal.
isequalwithequalnansTests array equality with NaN equal to NaN (older name of isequaln).
~=Not-equal operator: tests element by element whether two values differ.

Bit-Wise Operations

bitandBit-wise AND of integers.
bitcmpBit-wise complement of an integer.
bitgetReads bits of an integer at given positions.
bitorBit-wise OR of integers.
bitsetSets or clears bits of an integer at given positions.
bitshiftShifts the bits of an integer left or right.
bitxorBit-wise exclusive OR of integers.
swapbytesReverses the byte order of integers (endianness swap).

Set Operations

ismembertolTests set membership of floating-point values within a tolerance.
uniquetolUnique values of a floating-point array within a tolerance.