+ All Categories
Home > Documents > MATLAB Primer.pdf

MATLAB Primer.pdf

Date post: 02-Jun-2018
Category:
Upload: jc224
View: 232 times
Download: 0 times
Share this document with a friend

of 15

Transcript
  • 8/11/2019 MATLAB Primer.pdf

    1/15

    4 4

    A=

    16 3 2 135 10 11 89 6 7 124 15 14 1

    1 1

    =

    [ ]

    http://www4.ncsu.edu/unity/users/p/pfackler/www/MPRIMER.htmhttp://www.mathworks.com/help/techdoc/learn_matlab/bqr_2pl.html
  • 8/11/2019 MATLAB Primer.pdf

    2/15

    Aij i j A

  • 8/11/2019 MATLAB Primer.pdf

    3/15

    3 3

    1 2

    %

  • 8/11/2019 MATLAB Primer.pdf

    4/15

    %%

    20 1

    aj+1 = aj+ 0.25 aj j

    ==,=, > , < , >=,

  • 8/11/2019 MATLAB Primer.pdf

    5/15

  • 8/11/2019 MATLAB Primer.pdf

    6/15

    y = min{e2x+2, 20}

    PROGRAM

    ...

    global x;

    x=1:10;

    y=2;

    z=mult(y);

    ...

    FUNCTION

    function a=mult(b);

    global x;

    a=x*b;

  • 8/11/2019 MATLAB Primer.pdf

    7/15

    a b

    / /

  • 8/11/2019 MATLAB Primer.pdf

    8/15

    -30 -20 -10 0 10 20 30 40 500

    0.05

    0.1

    0.15

    0.2

    0.25

    0.3

    0.35Frequency distribution of monthly excess returns, 1932-2005

    Return

    Frequency,

    fraction

    Y = KL1

  • 8/11/2019 MATLAB Primer.pdf

    9/15

    m n {}

  • 8/11/2019 MATLAB Primer.pdf

    10/15

    { }

    f(x) f(x)

    f(x)f(x+) f(x )2

    f(x)

    f(x)f(x+) 2f(x) +f(x )2

    .

  • 8/11/2019 MATLAB Primer.pdf

    11/15

    x

    x

    f(x)

    x

    f x0

    x0 x

    f(x)f(x0) +f

    (x0)(x x0). f

    f(x)f(x0) +f(x0)(x x0)

    x x f(x) = 0 f(x0) +f

    (x0)(x x0)0

    x x0 f(x0)

    f(x0).

    x0 x

    x1x0 f(x0)

    f(x0).

    x1=x x1 x x0

    x1 x2

    x2x1 f(x1)

    f(x1)

    (n+ 1)

    xn+1xn f(xn)

    f(xn)

    x xn+1xn

    |xn+1xn|<

    = 1012

  • 8/11/2019 MATLAB Primer.pdf

    12/15

    x

    f

    (x) = 0

    x

    x

    x

    x

    f(x) =y f(x) y = 0 x

  • 8/11/2019 MATLAB Primer.pdf

    13/15

    x1+x22x3 = 03x1x3 = 52x1x2 = 1

    (x1, x2, x3)

    1 1 23 0 12 1 0

    x1x2x3

    =

    051

    A=

    1 1 23 0 12 1 0

    , x=

    x1x2x3

    , b=

    051

    Ax= b

    x x= A1b A1 A

    maxs

    U(c1, c2) = c111 +

    c121

    c1 = y s c2 = y + (1 +r)s ci i s y r

    s

    (y s) R(y+Rs) = 0.

    s =

  • 8/11/2019 MATLAB Primer.pdf

    14/15

    a, b x x[a, b] x f(x) = 0 f(a) f(b) x0 = 0.5(a+ b) f(x0) f(a) x0 b x1 = 0.5(x0+b) f(b) x1 = 0.5(x0+a)

    f(xn)0

    f(x)

    0

    a

    b

    c s c0 c1

    c0 (1 +r)c1 = 0c0+

    c11 +r

    y y1 +r

    = 0

    c0 c1

  • 8/11/2019 MATLAB Primer.pdf

    15/15

    a b

    20 1 aj+1 = aj+ 0.25 aj j

    y = x2 y = x3 y= ex y= log(x) y=

    x

    0< k


Recommended