Special Variables and Constants
|
Most recent answer |
|
The number π |
|
The smallest difference between two numbers. Equal to 2^(–52), which is approximately 2.2204e–016 |
|
infinity |
|
Not a number (i.e., division by zero) |
|
Returns the real part of a complex number x |
|
Returns the imaginary part of a complex number x |
Elementary Math Functions
|
Square root, Real nth root of a real number x. (If x is negative n must be an odd integer.) |
|
Exponential of x |
|
Absolute value of x |
|
Natural logarithm i.e. Base e logarithm (ln). |
|
Logarithm with base 2 and 10, respectively |
|
The factorial function n! (n must be a positive integer.) |
Trigonometric Math Functions
|
Sine and inverse (argument in radians) |
|
Sine and inverse (argument in degrees) |
|
Cosine and inverse (argument in radians) |
|
Cosine and inverse (argument in degrees) |
|
Tan and inverse (argument in radians) |
|
Tan and inverse (argument in degrees) |
Analogous for the other trigonometric functions: csc
, sec
, and cot
|
Rounding Functions
|
Round to the specified number of decimal places (n) |
|
Round toward zero |
|
Round toward infinity |
|
Round toward minus infinity |
|
Returns the remainder after x is divided by y |
|
Signum function. Returns 1 if x > 0, -1 if x < 0, and 0 if x = 0 |
Built-In Functions for Handling Arrays
|
Returns the number of elements in the vector A |
|
Returns a row vector [m,n], where m and n are the size m x n of the array A |
|
Rearrange a matrix A that has r rows and s columns to have m rows and n columns. r times s must be equal to m times n |
|
When v is a vector, creates a square matrix with the elements of v in the diagonal |
|
When A is a matrix, creates a vector from the diagonal elements of A. |
|
|
Built-in Functions for Analyzing Arrays
|
If A is a vector, returns the mean value of the elements of the vector |
|
If A is a vector, C is the largest element in A. If A is a matrix, C is a row vector of column max |
|
If A is a vector, d is the largest element in A, n is the position of the element (first if there are duplicates) |
|
Returns the smallest element of A |
|
d is the smallest element in A, n is the position (first if there are duplicates) |
|
If A is a vector, returns the sum of the elements of the vector |
|
If A is a vector, arranges the elements of the vector in ascending order |
|
If A is a vector, returns the median value of the elements of the vector |
|
Returns the determinant of a square matrix A. |
|
Calculates the scalar (dot) product of two vectors a and b. The vectors can each be row or column vectors |
|
Calculates the cross product of two vectors a and b, (a×b). The two vectors must have 3 elements. |
|
Returns the inverse of a square matrix A |
Built-in Logical Functions
|
equivalent to A&B |
|
equivalent to A|B |
|
equivalent to ~A |
|
Exclusive or. Returns true (1) if one operand is true and the other is false |
|
Returns 1 (true) if all elements in a vector A are true (nonzero). Returns 0 (false) if one or more elements are false (zero). If A is a matrix, treats columns of A as vectors, and returns a vector with 1s and 0s |
|
If A is a vector, returns the indices of the nonzero elements |
|
If A is a vector, returns the address of the elements that are larger than d (any relational operator can be used) |
Polynomials and Interpolation
|
Calculates the value of a polynomial at a point x |
|
Determines the root, or roots, of a polynomial |
|
Determines the coefficients of the polynomial when the roots of a polynomial are known |
|
Multiplies two polynomials |
|
Divides two polynomials and returns a vector with the coefficients of the quotient (q) as well as a vector with the coefficients of the remainder polynomial (r) |
|
Derivative of a single polynomial. p is a vector with the coefficients of the polynomial. k is a vector with the coefficients of the polynomial that is the derivative |
|
Derivative of a product of two polynomials. a and b are vectors with the coefficients of the polynomials that are multiplied. k is a vector with the coefficients of the polynomial that is the derivative of the product |
|
Derivative of a quotient of two polynomials. u and v are vectors with the coefficients of the numerator and denominator polynomials. n and d are vectors with the coefficients of the numerator and denominator polynomials in the quotient that is the derivative |
|
Polynomial curve fitting. p is the vector of the coefficients of the polynomial that fits the data. x is a vector with the horizontal coordinates of the data points (independent variable). y is a vector with the vertical coordinates of the data points (dependent variable). n is the degree of the polynomial. |
yi = interp1(x,y,xi,'method')
Methods: nearest (xi must be within the domain of x) linear (xi must be within the domain of x) spline (xi can have values outside the domain of x) pchip (xi can have values outside the domain of x) |
One-dimensional interpolation (the last character is the number one) xi is domain |
|