MATLAB function summary (a) - numerical operations and symbolic operations

System Command:
after clear variable name can be added, may be added '-expect c, a' in addition to a, c, clear all clears all variables, functions, MEX file
cd switch folders
clc clear the command line window
clf clears the current figure
close close the current Figure
close All Close all Figure
exit or quit exit

on the save function:
save filename all the variables in the current workspace to keep filename.mat binary file, this file in the current folder
save filename xyz specified variable name
save filename uvw -append go into the plus
save filename uvw -ascii -double not binary, and ascii code changed, and is 16, but still try to use binary files, may be wrong because ascii
save ( 'C: \\ Users \ \ hp \\ Desktop \\ US race && MATLAB \\ MATLAB program \\ file1.mat ',' A ', ' B ') stored in the specified location specified variable

load function:
load filename is keep the save, load is read, the filename the variables are read workspace
load filename xyz specify the variable name
load ( 'C: \\ Users \\ hp \\ Desktop \\ US race && MATLAB \\ MATLAB program \\ file1.mat', 'a', 'B') loaded in the specified location in the file specified variable
-------------------------------------------------
few special variables:
ANS default variable name
PI [pi]
INF infinity
eps precision floating-point, i.e. the minimum value (= 2.2204e-16) determined by the system is running
NaN nan or not quantitative, such as 0/0, INF / INF
I or the imaginary number j, I = j = sqrt
(-1) ------------------------------------- ------------
Some common functions:
ABS absolute value
sqrt square root
exp exponentiation
sin sine
cos cos
asin arcsine
acos inverse cosine
tan tangent
atan arctangent
log natural logarithm
common logarithm loglO
LCM least common multiple
The greatest common divisor gcd
imag imaginary part of the complex
real portion of the real complex
conj complex conjugate
---------------------------------- ---------------
matrix:
+, -, * not say, simply
\ left division eg: a \ B = inv ( a) * B
/ Right division eg: A / B = B * inv (A)
transpose A 'A is
the determinant det calculated matrix
inv inverse
rank the rank of Matrix
Eigenvalue EIG (stored in vector form)
Orth orthogonalization
poly seeking the characteristic polynomial
lu obtained by the coefficient matrix Gaussian elimination
qr matrix decomposition orthogonal trigonometric

polynomial:
poly2sym

    1. Return polynomial coefficient signs, high-order coefficients are sequentially output to the 0-order

    2. The polynomial coefficient array into symbols

      poly2sym ([. 5. 4. 3], 'X');

      ANS =
      . 3 * X ^ 2 + X +. 4. 5 *
+ plus
conv multiplication
deconv addition
polyder differential (i.e. derivative)
Roots Roots
polyval (p, 1) to x1 brought into the polynomial p
polyvalm (p, G) x is equal to the value of each position in the matrix G, a result is obtained with the same size and the same position of the G matrix of

a sparse matrix:
sparse matrix to a complete conversion of non-zero only records point (including the position and value)
full the matrix becomes a sparse matrix complete

array:
X = 0: 10 X = [0. 1. 5. 4. 3 2. 6. 7. 9 10. 8]
X = 0: 2: 10 X = [0 10. 6. 8. 4 2]
X = linspace (0,2,5) X = [0 0.5000 1.0000 1.5000 2.0000] the last parameter according to a Save aliquot

multi-dimensional matrix:
the RESHAPE a space to be converted into another form (according to the original the arrangement)
size of each dimension to obtain the length
ndims dimension obtained, corresponding to length (size (X))
CAT a new array dimension according to the specified synthesis
permute exchange dimensional
inverse ipermute permute, i.e. experienced in a given parameter, by permute change to this
shiftdim dimension of endless cycling movement, such as a three-dimensional array is now 1 * 2 * 3, is a three-dimensional array of 2 * 3 * 1 transformed
removed Squeeze singular dimension, i.e., length dimension of a dimensional
------- ------------------------------------------
symbolic variables: (If you do not specify a custom variable, MATLAB will nearest distance x as an argument letters, except i and j, x default)
sym given symbolic variables (eg: f = sym (a * x ^ 2 + b * x + c) df = diff ( f) (differential) results: df = 2 * a * x + b nf = int (f) ( integration) results: nf = 1/3 * a * x ^ 3 + 1/2 * b * x ^ 2 + c x *)
syms Fu own
findsym find symbolic expressions of symbolic variables, finfsym (X) returns the symbolic expression X in all the variables, findsym (X, n) returns the symbolic expression X x from the nearest n variables

limit:
limit (f, x, a) indicates when x approaches a limit f expression evaluation, when a = 0, the can be written limit (f)
limit (f, x, a, 'left') the left limit
limit (f, x, a, 'right') right limit

differential (rectifiable deflector):
the diff (F) of the independent variable a preset order differential
diff (f, t) of the independent variables Amount t of the first-order differential
diff (f, n) of the n-order differential preset variable
diff (f, t, n) of the independent variable t n-th order differential

integrator:
int (F) a preset integrated value of the independent variable
int (f, t) of the integrated value of the independent variable t
int (f, 't') of the integral value of an independent variable t
to preset independent variable in the interval [a, b] the int (f, a, b) of integrated value, a, b is a number
int (f, t, a, b) t independent variable integration value in the interval [a, b] the a, a, b is a number
int (f, 'm', ' n ') of the independent variable in a predetermined interval [m, n] on the integrated value, m, n is the symbol

Series:
symsum (S, v, A, B) S: general term v: arguments a, b: interval [A, B]
toylor (F, v, n-) seeking the arguments v F Taylor series expansion n-th order

algebraic equations:
Solve (f) solution symbol equation f ps: if f is a formula, i.e., the form of the function, it will give the general solution; if f has the equal sign, i.e. an equation, gives a direct solution
solve (f, a) solving specified variables a
solve (F1, F2, ......, Fn) solving the equations, returns an array

of ordinary differential equations:
for derivatives within deSolve ( 'equation', 'for condition Condition') solving ordinary differential equations, equation representative of the differential equation, condition represents the initial conditions (may be a multiple use "," spaced apart), if there is no initial condition, the general solution is given

common symbols functions:
operation function:
symadd symbol addition
symsub symbol subtraction
symmul signed multiply
symdiv symbol division
sympow symbol power of operation
numden converted from rational form of a fractional
numeric represented in numerical form
compose (f (x), g (x)) to f (x) and g (x) combined into F (g (x)) form
finverse right inverse
sym2poly polynomial coefficients extracted and displayed in vector form
poly2sym polynomial coefficient vector into No. polynomial form

of simple functions (simple !!!):
The combined power of the same collect
expand the expanded expression (inverse of factorization)
factor factoring
simplify rules using a function of the algebraic expressions simplify
simple as possible to simplify, with minimal word expressed
[R & lt, how] = simple (s) simplification s, r is the sign variable, how is a method which

format conversion and symbol values: sym (pression, 'parameter')
parameters f: a floating-point value
parameter r: Back rational (default)
parameters e: rational return a floating-point value with the machine error
parameters d: return decimal value

set variable types:
x = sym ( 'x', 'real') is set to a real number type x
x = sym ( 'x', ' unreal') to cancel the setting
sym xy real variables specify a real number multiple

expression substitution:
SUBS (s) assigned by the expression given symbolic expression value replacing all variables s (initial value assigned)
SUBS (s, new) replacing all of the free variable s with new
SUBS (s, old, new) replacing old with new

arbitrary precision calculation:
digits (n) is n bits of significant digits specified
vpa (s , n) S is represented in the form of significant digits n, when n default to display the default

symbols integral transform:
Fourier Transformation:
F = fourier (f) of the Fourier transform for f, the default is the independent variable is x, the default is to return the result of the function w, i.e., F. (W), if f w is the argument, the function returns T
F = fourier (F, V) w to> V
F = Fourier (F, U, V) X-> U; w to> V
inverse Fourier transform: ifourier

Laplace transform:
L = Laplace (F) of the required F Laplace transform, the default is the independent variable is t, the function returns the result s default, i.e. L (s), if the argument of F s, t function returns
L = laplace (F, t) s-> T
L = Laplace (F., W, Z) S-> Z; T-> W
inverse Laplace transform: ilaplace

Z transform:
F. Ztrans = (f) Z-transform of f required, the default is the independent variable is n, return result default function of z, i.e., F. (z)
F. Ztrans = (F, W) F. (W)
F. Ztrans = (F, k, W) is the argument k
inverse Z transform: iztrans

Guess you like

Origin www.cnblogs.com/bwjblogs/p/11900479.html