1) Function for scalar

sin
cos
exp
sqrt
rem
round
floor % 버림 함수, (-)을 향해서 버림.
fix % 버림 함수, 0을 향해서 버림.
sign
cell

2) Function for vector

Functions that take vector input (row or col)
Most of them can take matrix input (vectorization)
⇒ act on columns and return results in row vector

max % 만약 a = rand(10,4)의 최댓값 하나를 구하고 싶다면 max(max(a))
sum
min
prod
mean
sort % 정렬
std % 표준편차

3) Functions that take matrix input

eig : eigenvalues and eigenvectors
chol : cholesky factorization
svd : singular value decomposition
inv : inverse
lu: LU factorization
qr : QR factorization
expm : matrix exponential
sqrtm : matrix square root
poly : characteristic polynomial
det : determinant
size : size
norm : 1-norm, 2-norm, F-norm, infinity-norm
cond : condition number in the 2-norm
rank : rank

* Eigenvalues and Eigenvectors ⇒ Ax(eigenvector) = λ(eigenvalue)x
A = rand(4,3)
[V, D] = eig(A) % 여기서 V : eigenvector, D : eigenvalue
V = 0.6409 + 0.0000i  -0.3872 - 0.2454i  -0.3872 + 0.2454i
    0.4814 + 0.0000i   0.8298 + 0.0000i   0.8298 + 0.0000i
    0.5979 + 0.0000i   0.0053 + 0.3184i   0.0053 - 0.3184i
D = 1.0912 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i
    0.0000 + 0.0000i   0.0390 + 0.2215i   0.0000 + 0.0000i
    0.0000 + 0.0000i   0.0000 + 0.0000i   0.0390 - 0.2215i
    
v1 = V(:,1); d1 = D(1,1)
A * v1 - d1 * v1 = 0
v2 = V(:,2); d2 = D(2,2)
A * v2 - d2 * v2 = 0
v3 = V(:,3); d3 = D(3,3)
A * v3 - d3 * v3 = 0

4) Function with Logical Output

isequal : test arrays for equality % ==도 있는데 굳이?, 
                                   % isequal의 진가는 vector를 비교할 때 나온다. 
                                   % 예를 들어, [1 2] == [1 3 2]은 error를 주는데 isequal([1 2], [1 3 2])을 하면 0을 준다.

isfinite : find elements that are finite
isnan : find elements that are NaN
isinf : find elements that are infinite

isempty : true if array is empty
isnumeric : true if array is numeric
isinteger : true if array is integer
isreal : true if array is real
islogical : true if array is logical
ischar : true if array is character

isglobal : true if array is global
isscalar : true if array is scalar
isvector : true if array is 1D vector
ismatrix : true if array is 2D matrix
isrow : true if array is row vector
iscolumn : true if array is column vector

any : true if any element is nonzero
all : true if all elements are nonzero

exist : determine whether variable or function exists
exist('A') returns :
		0 if A does not exist
        	1 if A is a variable in the workspace
            	2 if A is an M-file on MATLAB's search path
                5 if A is a built-in MATLAB function

0개의 댓글