Mathematics > Elementary Math
130 functions in MATLAB › Mathematics > Elementary Math.
Complex Numbers
abs | Absolute value of real numbers and magnitude of complex numbers. |
angle | Phase angle of complex numbers. |
complex | Creates a complex array from real and imaginary parts. |
conj | Complex conjugate of each element. |
cplxpair | Sorts complex numbers into conjugate pairs. |
i | Imaginary unit, the square root of -1. |
imag | Imaginary part of a complex number. |
j | Imaginary unit, equivalent to i. |
real | Real part of a complex number. |
sign | Sign of each element: -1, 0 or 1. |
unwrap | Removes jumps of more than pi in a phase sequence by adding multiples of 2*pi. |
Trigonometry
acos | Inverse cosine of each element, with the result in radians. |
acosd | Inverse cosine of each element, with the result in degrees. |
acosh | Inverse hyperbolic cosine of each element, with the result in radians. |
acot | Inverse cotangent of each element, with the result in radians. |
acotd | Inverse cotangent of each element, with the result in degrees. |
acoth | Inverse hyperbolic cotangent of each element. |
acsc | Inverse cosecant of each element, with the result in radians. |
acscd | Inverse cosecant of each element, with the result in degrees. |
acsch | Inverse hyperbolic cosecant of each element. |
asec | Inverse secant of each element, with the result in radians. |
asecd | Inverse secant of each element, with the result in degrees. |
asech | Inverse hyperbolic secant of each element. |
asin | Inverse sine of each element, with the result in radians. |
asind | Inverse sine of each element, with the result in degrees. |
asinh | Inverse hyperbolic sine of each element. |
atan | Inverse tangent of each element, with the result in radians. |
atan2 | Four-quadrant inverse tangent. |
atan2d | Four-quadrant inverse tangent, with the result in degrees. |
atand | Inverse tangent of each element, with the result in degrees. |
atanh | Inverse hyperbolic tangent of each element. |
cart2pol | Converts Cartesian coordinates to polar or cylindrical. |
cart2sph | Converts Cartesian coordinates to spherical coordinates. |
cos | Cosine of an angle given in radians. |
cosd | Cosine of an angle given in degrees. |
cosh | Hyperbolic cosine of each element. |
cospi | Accurate cosine of X times pi. |
cot | Cotangent of an angle given in radians. |
cotd | Cotangent of an angle given in degrees. |
coth | Hyperbolic cotangent of each element. |
csc | Cosecant of an angle given in radians. |
cscd | Cosecant of an angle given in degrees. |
csch | Hyperbolic cosecant of each element. |
deg2rad | Converts angles from degrees to radians. |
hypot | Square root of the sum of squares, without overflow. |
pol2cart | Converts polar or cylindrical coordinates to Cartesian. |
rad2deg | Converts angles from radians to degrees. |
sec | Secant of an angle in radians, 1/cos(x). |
secd | Secant of an angle in degrees. |
sech | Hyperbolic secant, 1/cosh(x). |
sin | Sine of an angle in radians. |
sind | Sine of an angle in degrees. |
sinh | Hyperbolic sine. |
sinpi | Sine of pi times x, exact at integer and half-integer multiples. |
sph2cart | Converts spherical coordinates to Cartesian. |
tan | Tangent of an angle in radians. |
tand | Tangent of an angle in degrees. |
tanh | Hyperbolic tangent. |
Special Functions
airy | Airy functions and their derivatives. |
besselh | Bessel function of the third kind (Hankel function). |
besseli | Modified Bessel function of the first kind. |
besselj | Bessel function of the first kind. |
besselk | Modified Bessel function of the second kind. |
bessely | Bessel function of the second kind. |
beta | Beta function of two arguments. |
betainc | Regularized incomplete beta function. |
betaincinv | Inverse of the regularized incomplete beta function. |
betaln | Natural logarithm of the beta function. |
ellipj | Jacobi elliptic functions sn, cn and dn. |
ellipke | Complete elliptic integrals of the first and second kind. |
erf | Error function of real values. |
erfc | Complementary error function. |
erfcinv | Inverse of the complementary error function. |
erfcx | Scaled complementary error function, exp(x^2) times erfc(x). |
erfinv | Inverse error function. |
expint | Exponential integral E1(x). |
gamma | Gamma function, the extension of the factorial to real numbers. |
gammainc | Regularized incomplete gamma function. |
gammaincinv | Inverse of the regularized incomplete gamma function. |
gammaln | Natural logarithm of the gamma function. |
legendre | Associated Legendre functions of degree n. |
psi | Digamma function and its higher derivatives (polygamma). |
Constants and Test Matrices
compan | Companion matrix of a polynomial. |
gallery | Collection of named test matrices. |
hadamard | Hadamard matrix of +1 and -1 entries. |
hankel | Hankel matrix, constant along each anti-diagonal. |
hilb | Hilbert matrix, with entries 1/(i+j-1). |
invhilb | Exact inverse of the Hilbert matrix. |
magic | Magic square: equal row, column and diagonal sums. |
pascal | Pascal matrix built from binomial coefficients. |
pi | The constant pi, the ratio of a circle's circumference to its diameter. |
rosser | Rosser matrix, a classic eigenvalue test matrix. |
toeplitz | Builds a Toeplitz matrix, with constant values along each diagonal. |
vander | Vandermonde matrix whose columns are decreasing powers of the input vector. |
wilkinson | Wilkinson's symmetric tridiagonal eigenvalue test matrix of order n. |
Polynomials
conv | Convolution of two vectors, or polynomial multiplication. |
deconv | Deconvolution and polynomial division. |
poly | Coefficients of the polynomial with given roots, or the characteristic polynomial of a matrix. |
polyder | Derivative of a polynomial, or of a product or quotient of polynomials. |
polyeig | Eigenvalues of a polynomial eigenvalue problem. |
polyfit | Least-squares polynomial fit to data. |
polyint | Integral of a polynomial. |
polyval | Evaluates a polynomial at given points. |
polyvalm | Evaluates a polynomial with a square matrix as the variable. |
residue | Partial fraction expansion of a ratio of polynomials. |
roots | Roots of a polynomial. |
Exponents and Logarithms
exp | Exponential function e^x, element by element. |
expm1 | Accurate exp(x) - 1 for small x. |
log | Natural logarithm, element by element. |
log10 | Common (base 10) logarithm. |
log1p | Accurate log(1 + x) for small x. |
log2 | Base-2 logarithm. |
nextpow2 | Exponent of the next power of two at or above abs(x). |
nthroot | Real n-th root of a real number. |
pow2 | Power of two, or a number scaled by a power of two. |
reallog | Natural logarithm that errors on complex results. |
realpow | Element-wise power that errors on complex results. |
realsqrt | Square root that errors on complex results. |
sqrt | Square root, element by element. |
Discrete Math
factor | Prime factorization of a positive integer. |
factorial | Factorial n! of nonnegative integers. |
gcd | Greatest common divisor of integers. |
isprime | Tests which elements are prime numbers. |
lcm | Least common multiple of integers. |
matchpairs | Optimal assignment of rows to columns of a cost matrix. |
nchoosek | Binomial coefficient: the number of ways to choose k of n items. |
perms | All permutations of the elements of a vector. |
primes | List of all prime numbers up to a limit. |
rat | Rational approximation of a number by continued fractions. |
rats | Rational output: a number formatted as a fraction in a string. |