Language Fundamentals > Operators and Elementary Operations
62 functions in MATLAB › Language Fundamentals > Operators and Elementary Operations.
Logical (Boolean) Operations
& | Element-wise logical AND operator. |
all | Tests whether all elements are nonzero (true). |
any | Tests whether any element is nonzero (true). |
find | Finds the indices of nonzero elements. |
logical | Converts 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. |
xor | Logical 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. |
bsxfun | Applies a binary function with implicit expansion of singleton dimensions. |
ceil | Rounds toward positive infinity. |
cumprod | Cumulative product of array elements. |
cumsum | Cumulative sum of array elements. |
diff | Differences between adjacent elements. |
fix | Rounds toward zero, discarding the fractional part. |
floor | Rounds toward negative infinity. |
idivide | Integer division with a chosen rounding rule. |
mod | Remainder after division, with the sign of the divisor (modulo). |
movsum | Moving sum over a sliding window. |
pagectranspose | Conjugate-transposes each page of an N-D array. |
pagemldivide | Solves linear systems page by page, A \ B for each page. |
pagemrdivide | Right division page by page, A / B for each page. |
pagemtimes | Matrix multiplication page by page for N-D arrays. |
pagetranspose | Transposes each page of an N-D array. |
prod | Product of array elements. |
rem | Remainder after division, with the sign of the dividend. |
round | Rounds to the nearest integer, or to a given number of digits. |
tensorprod | Tensor product and contraction of arrays along chosen dimensions. |
uminus | Unary minus: changes the sign of each element. |
uplus | Unary 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. |
isequal | Tests whether arrays are equal in size and content. |
isequaln | Tests array equality, treating NaN values as equal. |
isequalwithequalnans | Tests 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
bitand | Bit-wise AND of integers. |
bitcmp | Bit-wise complement of an integer. |
bitget | Reads bits of an integer at given positions. |
bitor | Bit-wise OR of integers. |
bitset | Sets or clears bits of an integer at given positions. |
bitshift | Shifts the bits of an integer left or right. |
bitxor | Bit-wise exclusive OR of integers. |
swapbytes | Reverses the byte order of integers (endianness swap). |
Set Operations
ismembertol | Tests set membership of floating-point values within a tolerance. |
uniquetol | Unique values of a floating-point array within a tolerance. |