|
⇤ ← Revision 1 as of 2025-10-22 18:19:55
Size: 2439
Comment: Initial commit
|
Size: 3508
Comment: Reorg
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 11: | Line 11: |
| == Description == | == Numeric Functions == |
| Line 13: | Line 13: |
| === Mathematical Functions === | Most built-in functions operate on [[MATLAB/DataTypes#Numeric|numeric arrays]] by applying the function element-wise. These include: === Mathematical functions === |
| Line 29: | Line 31: |
| === Trig Functions === | === Trig functions === |
| Line 57: | Line 59: |
| === Matrix Functions === | === Type-checking functions === ||'''Name''' ||'''Meaning''' || ||`allfinite(x)`||are all elements finite || ||`anynan(x)` ||are any elements NaN || ||`isfloat(x)` ||is a floating-point array || ||`isinteger(x)`||is an integer array || ||`isnumeric(x)`||is a numeric array || ||`isreal(x)` ||uses complex storage || ---- == String Functions == These functions operate on a [[MATLAB/DataTypes#String|string array]] and return a string scalar: ||'''Name''' ||'''Meaning''' || ||`join(s)` ||join the elements of string matrix `s` || ||`join(s,d)`||join the elements of string matrix `s` using delimiter `d`|| ---- == Matrix Functions == These functions return a matrix: |
| Line 61: | Line 91: |
| ||`diag(m)` ||diagonal vector from matrix `m`|| | |
| Line 65: | Line 94: |
These functions operate on a matrix: ||'''Name''' ||'''Meaning''' || ||`diag(m)` ||diagonal vector from matrix `m`|| |
MATLAB Built-in Functions
Several functions are built into MATLAB.
Contents
Numeric Functions
Most built-in functions operate on numeric arrays by applying the function element-wise. These include:
Mathematical functions
Name |
Meaning |
abs(x) |
absolute value |
ceil(x) |
round toward positive infinity |
exp(x) |
exponentiation |
factorial(x) |
factorial |
fix(x) |
round toward 0 |
floor(x) |
round toward negative infinity |
log(x) |
natural logarithm |
log10(x) |
base-10 logarithm |
mod(x,d) |
modulo of x divided by d |
nthroot(x,n) |
nth root of x |
round(x) |
round to integer |
sqrt(x) |
square root |
Trig functions
Name |
Meaning |
sin |
sine |
cos |
cosine |
tan |
tangent |
cot |
cotangent |
sec |
secant |
csc |
cosecant |
asin |
inverse sine |
acos |
inverse cosine |
atan |
inverse tangent |
acot |
inverse cotangent |
asec |
inverse secant |
acsc |
inverse cosecant |
sinh |
hyperbolic sine |
cosh |
hyperbolic cosine |
tanh |
hyperbolic tangent |
coth |
hyperbolic cotangent |
sech |
hyperbolic secant |
csch |
hyperbolic cosecant |
asinh |
inverse hyperbolic sine |
acosh |
inverse hyperbolic cosine |
atanh |
inverse hyperbolic tangent |
acoth |
inverse hyperbolic cotangent |
asech |
inverse hyperbolic secant |
acsch |
inverse hyperbolic cosecant |
Type-checking functions
Name |
Meaning |
allfinite(x) |
are all elements finite |
anynan(x) |
are any elements NaN |
isfloat(x) |
is a floating-point array |
isinteger(x) |
is an integer array |
isnumeric(x) |
is a numeric array |
isreal(x) |
uses complex storage |
String Functions
These functions operate on a string array and return a string scalar:
Name |
Meaning |
join(s) |
join the elements of string matrix s |
join(s,d) |
join the elements of string matrix s using delimiter d |
Matrix Functions
These functions return a matrix:
Name |
Meaning |
diag(v) |
diagonal matrix from vector v |
eye(n) |
n x n identity matrix |
ones(n) |
n x n matrix of 1s |
zeros(n) |
n x n matrix of 0s |
These functions operate on a matrix:
Name |
Meaning |
diag(m) |
diagonal vector from matrix m |
