Вы находитесь на странице: 1из 3

MATLAB

 Information  and  Formulas  


OPERATOR  PRECEDENCE   fprintf  SPECIFIER  
1 ()   Parentheses %d   Integer
.’    ‘   Transpose, Matrix Transpose, Fixed-Point
2 %f  
.^    ^   Power, Matrix Power Notation

3 ~   Logical Negation Exponential


%e  
Notation
.*    *   Multiplication, Matrix Multiplication,
String of
%s  
4 ./    /   Right Division, Matrix Right Division, Characters
.\    \   Left Division, Matrix Left Division %c   Single Character
+   Addition \t   Horizontal Tab
5
-­‐   Subtraction \n   New Line
6 :   Colon Operator %%   Percent Character
Less Than, Less Than Or Equal \’
<      <=   To, Single Quote Mark
’  
7 >      >=   Greater Than, Greater Than Or Equal
To, \\   Backslash
==    ~=  
Equal To, Not Equal To \b   Backspace
8 &   Element-wise AND
9 |   Element-wise OR Fixed-­‐Point  Notation  Syntax  
1 %<field_width>.<precision>f  
&&   Short-circuit AND
0
1
||   Short-circuit OR
1

COLOR  SPECIFIER   LINE  STYLE  SPECIFIER   MARKER  TYPE  SPECIFIER  


r   Red -­‐   Solid Line +   Plus Sign
g   Green -­‐-­‐   Dashed Line o   Circle
*   Asterisk
b   Blue :   Dotted Line .   Point
c   Cyan -­‐.   Dash-dot Line x   Cross
s   Square
m   Magenta d   Diamond
y   Yellow ^   Triangle (Up)
v   Triangle (Down)
k   Black >   Triangle (Right)
w   White <   Triangle (Left)

ENG1060  Computing  for  Engineers                            Page 1 of 3


 
Root  Finding  

Bisection  Method   False  Position  Method  


xl + xu f ( xu )( xl − xu )
xr = xr = xu −  
2   f ( xl ) − f ( xu )

Newton-­‐Raphson  Method   Secant  Method  


f ( xi ) f ( xi )( xi −1 − xi )
xi +1 = xi − xi +1 = xi −
f ' ( xi ) f ( xi −1 ) − f ( xi )

Modified  Secant  Method   Alternative  Modified  Secant  Method  


δxi f ( xi ) δ f (xi )
xi +1 = xi − xi+1 = xi −
f ( xi + δxi ) − f ( xi ) f (xi + δ ) − f (xi )

Curve  Fitting  
Linear  Regression:
Coefficient  of  
y = ao + a1 x
Determination  
n∑ xi yi − ∑ xi ∑ yi St − S r
a1 = r2 =
n∑ xi2 − (∑ xi )
2 St
Linearizing  Nonlinear  Models  
a0 = y − a1 x Nonlinear Linearized

y = α1e β1x ln y = lnα1 + β1x

Standard  Deviation   Standard  Error  of  the   y = α 2 x β2 log y = logα2 + β2 log x


n
Regression  Estimate  
S t = ∑ ( yi − y ) 2 n x 1 1 β3 1
i =1
S r = ∑ ( y i − a 0 − a1 xi )
2 y = α3 = +
β3 + x y α3 α3 x
i =1
St
sy =
n −1 Sr
sy / x =
n−2

                             Page  2  of  3  
Numerical  Integration  (n  is  the  number  of  points)  

Trapezoidal  Rule:   Composite  Trapezoidal  Rule  


f (b) + f (a ) h ⎡ n −1
⎤
I = (b − a ) I= ⎢ f ( x1 ) + 2 ∑ f (xi ) + f (xn )⎥
2 2 ⎣
  i=2 ⎦
1 3 (b − a)
Et = − f ʹ′ʹ′(ξ )(b − a ) where h=  
12 n −1
 

Composite  Trapezoidal  Rule  with  Unequal  Segments  


f (x2 ) + f (x1 ) f (x3 ) + f (x2 ) f (xn−1 ) + f (xn )
I = (x2 − x1 ) + (x3 − x2 ) + ! + (xn − xn−1 )
2 2 2

Simpson’s  1/3  Rule   Simpson’s  3/8  Rule  


h 3h
I = [ f (x1 ) + 4 f (x2 ) + f (x3 )] I = [ f (x1 ) + 3 f (x2 ) + 3 f (x3 ) + f (x4 )]
3 8
1 1
Et = − f ( 4) (ξ )(b − a )
5
Et = − f ( 4) (ξ )(b − a)5
2880 6480
 

⎡ n −1 n−2
⎤
h ⎢
Composite  Simpson’s  1/3  Rule:     I = ⎢ f (x1 ) + 4 ∑ f (xi ) + 2 ∑ f (x j ) + f (xn )⎥
⎥
3 i = 2 , 4 , 6 ,... j =3, 5, 7 ,...
⎢⎣ i , even j , odd ⎥⎦

ODE:  Initial  Value  Problems  

Euler’s  Method   Heun’s  Method   Midpoint  Method  


0
yi +1 = yi + f (t i , yi )h y = yi + f (ti , yi )h h
i +1
yi +1/ 2 = yi + f (ti , yi )
f (ti , yi ) + f (ti +1 , yi0+1 ) 2
yi +1 = yi + h h
2 t i +1 / 2 = t i +
2
yi +1 = yi + f (ti +1/ 2 , yi +1/ 2 )h

                             Page  3  of  3  

Вам также может понравиться