Matlab sistemas de Matrices y Vectores

download Matlab sistemas de  Matrices y Vectores

of 23

Transcript of Matlab sistemas de Matrices y Vectores

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    1/23

    AC AAB

    CAE . 2

    1.  E EA GA

    E N. 2 S MATLAB . M

    . T ( ,

    ).

    2.  DCC

    MATLAB . E MATLAB

    , ,

    . E MATLAB (

    ).

    3.  DEFC DE ACE ECE

    L , ,

    . P , . S

    (H Z)

    . L , ,

    :

    1 :

    H: 8 T , 4 T , 12 T Z: 6 T , 3 T , 12 T .

    2 :

    H: 10 T , 6 T , 5 T

    Z: 9 T , 5 T , 4 T

    3 :

    H: 7 T , 8 T , 5 T

    Z: 7 T , 0 T , 5 T .

    4 :

    H: 11 T , 7 T , 0 T

    Z: 11 T , 6 T , 5 T .

    E . A

    T 1 2.

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    2/23

      T 1. I H T 2. I Z

    L M A L M A

    1 S 6 2 10 1 S 6 3 12

    2 S 8 4 3 2 S 9 5 4

    3 S 5 6 3 3 S 7 0 5

    4 S 9 5 0 4 S 11 6 0

    E , () (). C .

    E , , :

    11 12 13

    21 22 23

    31 32 33

    41 42 43

    LevaduraMalta

    Agua

    Fila 1, Semana1

    Fila 2, Semana 2

    Fila 3, Semana 3

    Fila 4, Semana 4

    || |

    a a aa a aa a a

    a a a

    − − − − − − − −− − − − − −

    − − − −↓ ↓ ↓

    → →

    = →

    A

     

    E T 1 2,

    ,

    . E , ,

    , , , , .

    A ,

    MATLAB.

    E MATLAB . S

    (MATLAB , ). L

    ;

    (;). P , H

    T 1 H:

    >> H = [6 2 10; 8 4 3; 5 6 3; 9 5 0]

    L :

    H =

    6 2 10

    8 4 3

    5 6 3

    9 5 0

    A H , W:

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    3/23

     

    E W : H 43 ( ), 10. M Z, .

    4.  DECCAE DE ACE

    Y MATLAB, . D M (

    ) .

    C , H, 0 7 T. C ?

    P , ( 4 3, ) 7. E :

    >> H(4,3)=7

    E :

    H =6 2 10

    8 4 3

    5 6 3

    9 5 7

    P , 7S , ( H) , , , .

    A, , C H,

    . S T 1, , :

    T 1. I H

    L

    1 S 6

    2 S 8

    3 S 5

    P , MATLAB:

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    4/23

    >> parcial = H(1:3,1)

    E :

    parcial =

    6

    8

    5

    L :   1 3 H:

    parcial = H(1:3,1) 

    O , H .

    E HL :

    >> agua = H(:,3)

    E :

    agua =

    10

    3

    3

    7

    L :   3 H:

    parcial = H(:,3) 

    D (

    :

    >> semana2 = H(2,:)

    E :

    semana2 =

    8 4 3 

    P T 1 .

    C 1

    F 1 3

    C 3

    T F

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    5/23

    F, [ ]. P , 1 4 H ( , : ):

    >> H([1 4],:)

    E :

    ans =

    6 2 10

    9 5 7

    F, H(:) H .

    5.  DEFC DE ECE E AAB

    C , MATLAB. E , .

    U ( ) ( ). V 4, 1, 2, 3 4. C Z :

    L M A

    1 1 S 6 3 122 2 S 9 5 43 3 S 7 0 54 4 S 11 6 0

    C , . L ( 4 , ):

    >> z1 = [6 3 12];

    >> z2 = [9 5 4];

    >> z3 = [7 0 5];

    >> z4 = [11 6 0 3];

    C , .

    6.  DECCAE DE ECE

    S , , , (. H(1,3)). C , ( 1).

    P , , Z 0 5 .

    E, 4:

    >> z4(3)=7

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    6/23

    E :

    z4 =

    11 6 7 3

    7.  BAD DE EEE

    E 4 , . E []:

    >> Z(3) =[]

    E :

    z4 =

    11 6 7

    E 4 [].

    8.  CCAEAC DE ACE

    E MATLAB . E .

    P , 1, 2, 3, 4 Z, Z . E :

    >> Z = [z1; z2; z3; z4]

    E :

    Z =

    6 3 12

    9 5 4

    7 0 5

    11 6 7

    N , .

    C , MATLAB H Z . E , , . E , , .

    S :

    >> [H Z]

    E :

    ans =

    6 2 10 6 3 12

    8 4 3 9 5 4

    5 6 3 7 0 5

    9 5 7 11 6 7

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    7/23

    S :

    >> [H;Z]

    E :

    ans =

    6 2 10

    8 4 35 6 3

    9 5 7

    6 3 12

    9 5 4

    7 0 5

    11 6 7

    9.  DEFC DE ECE AD D

    A , .

    C MATLAB, S(), . N MATLAB Y =()

    Y . . E . S, , MATLAB .

    S , , . H , A , .

    A , , X=[0 0.1 0.2 ] 6, , . P . C

    :

    >> x=[0:2*pi]

    E :

    x =

    0 1 2 3 4 5 6

    L : X 0 2* (MATLAB =3.1416). MATLAB 2* ( , ).

    S , :

    >> plot(x,sin(x))

    Y :

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    8/23

     

    L , . V :

    >> x=[0:0.1:2*pi];

    S , W 63 , 6.2.

    L 0 2*, MATLAB 1 1, 0.1 ( = [0 0.1 0.2 0.3 0.4 6.2].

    A :

    >> plot(x,sin(x))

    Y :

    E (63 ).

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    9/23

    10. ACE EDEFDA

    E MATLAB . A :

    (4) (44)

    (3,5) (35)

    (4) (44)

    (3) (33)

    (2,4) (24)

    (1,2,) 1 2

    (1,2,) 10^1 10^2.

    (2,5) 0 1, , (25)

    (5) 0 1, , (55)

    (4) (44), , 0 1.

    (4,3) (43), , 0 1.

    (4) (44) . E

    2.

    11. FAC DE A A A A DE A

    MATLAB ,

    :

       ( ),

       .

    A , :

    A=() A

    =(A) A

    (A) A

    (A) A

    90(A,)G *90 A . . S , =1

    (A) A

    (A) A

    (A,,)C A A

    . S A .

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    10/23

    A , :

    >> A = rand(3)

    >> B = diag(diag(A))

    >> C = [A, eye(3); zeros(3), B]

    E , C (66)

    (33). A , . L .

    12. BEE FAC BE ACE

    A . P :

    (A) A

    ()

    13. EADE AC

    MATLAB . L MATLAB :

    1. AAB

    +

     

    *

    ^

    \

    /

    .*

    ./

    .\

    .^

    (A). A.

    A H Z

    S , H 2

    ,

    . S 2 , :

    >> H = H+2

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    11/23

    E :

    H =

    8 4 12

    10 6 5

    7 8 5

    11 7 9

    S

    . P

    , :

    V S. E MATLAB, :

    >> Suma = H + Z

    E :

    Suma =

    14 7 24

    19 11 9

    14 8 10

    22 13 16

    P , . P

    :

    >> Resta = H - Z

    E :

    Resta =

    2 1 0

    1 1 1

    0 8 0

    0 1 2

    H H Z. L

    , ( 1 3

    , 3 4, ). E

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    12/23

    ( ), H Z . P

    . E Z

    H .

    A, 5

    H, H. E , H:

    >> producto = 5*H

    E :

    producto =

    40 20 60

    50 30 25

    35 40 25

    55 35 45

    A (H AG M ). A

    : ,

    ?. L

    :

    E P,

    ( , , , ,

    , H AG M .):

    50 55136 12780 79

     P 

     

    D MATLAB:

    >> P =[50 55; 136 127; 80 79];

    A . E

    .

    E , :

    ( ) ( ) ( )*$ *$ *$Costo semana levadura levadura malta malta agua agua= + +  

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    13/23

    E , (H Z) . H

    H:

    C H H AG:

    1 : (8 )*(50 $/ )+ (4 )*(136 $/ ) +(12 )*(80$/ ) =1904

    2 : (10 )*(50 $/ )+ (6 )*(136 $/ ) +(5 )*(80$/ ) =1716 

    3 : (7 )*(50 $/ )+ (8 )*(136 $/ ) +(5 )*(80$/ ) =1838 

    4 : (11 )*(50 $/ )+ (7 )*(136 $/ ) +(9 )*(80$/ ) =2222 

    C H .:

    1 : (8 )*(55 $/ )+ (4 )*(127 $/ ) +(12 )*(79$/ ) =1896

    2 : (10 )*(55 $/ )+ (6 )*(127 $/ ) +(5 )*(79$/ ) =1707 

    3 : (7 )*(55 $/ )+ (8 )*(127 $/ ) +(5 )*(79$/ ) =1796 

    4 : (11 )*(55 $/ )+ (7 )*(127 $/ ) +(9 )*(79$/ ) =2205 

    E . V H P

    ( H AG 

    .):

    8 4 12 8* 4* 12* 8* 4* 12*10 6 5 10* 6* 5*

    50 136 80 19045050 136

    55 127 79 18965555 12710* 6* 5   79*

    * *7 8 5 7

    80136

    50 1* 6* 5* 7* 8* 5*11

    36 807 9 11* 7* 9* 11* 7* 9

    12755 127 79

    7955 127 7

    80*   950 136 80

     K H P 

    + + + + + + + + = = = = + + + + + + + +

    1716183822

    1707179622022   5

     

    E MATLAB :

    >> K=H*P

    E :

    K =

    1904 1896

    1716 1707

    1838 1796

    2222 2205

    A H P, H*P, (

    ) . E , H

    (, ) P .

    L H*P :

    •  E H ( ) H ( ).

    •  E P ( )

    P ( ).

    D H AG

    , M :

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    14/23

     C ( ),

    H M .

    S (

    ). P :

    >> sum(K)

    E :

    ans =

    7680 7604

    E , , $7.680 HAG $7.604 M .

    .

    A: A ,   ,

    . S ,

    .

    E MATLAB (') . T

    ( ).

    P , K, :

    >> T = K'

    E :

    T =

    1904 1716 1838 2222

    1896 1707 1796 2205

    P K T K T ( T K). S (T) T, K:

    >> sum(T)

    E :

    ans =

    3800 3423 3634 4427

    1796

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    15/23

    14. EE ACA DE ACE

    A , MATLAB.

    EE 1

    C :

    .)  C () ,

    S 12 ( ) :

    .) C ?

    S :

    E M ; 7476

    EE 2

    L VST A L . S , ,

    . L ( )

    3 :

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    16/23

     E . C

    ?

    E :

    R:

    L ( ) :

    E R AG .

    15. EADE AA A EC DE EA DE ECACE EAE

    MATLAB . P , . C ,

    A =

    , A . L 2 :

    = (A)*

    = A\

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    17/23

    A , ( \) . E , ( ) . C E , .

    EE 3

    E

    , ,

    . H

    , . D

    , . E

    . C M ,

    . P ,

    3 4

    1 2 M 

      − =

     

    S :

    AAE A

    R

    0. P , :

    1   10 19 2 11 20 3 12 21 4 13 22

    5 14 23 6 15 24 7 16 25 8 17 26 9 18 27

    E 1, 21, 1, 18, 22, 5, 14, 0, 26, 1.

    D MATLAB:

    >> m=[1 21 1 18 22 5 14 0 26 1]

    E :

    m =

    1 21 1 18 22 5 14 0 26 1

    E ( M,

    , 2 ). M :

    >> length(m)

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    18/23

    E :

    ans =

    10

    P , 25. P :

    >> m = reshape(m,2,5)

    E :

    m =

    1 1 22 14 26

    21 18 5 0 1

    V M MATLAB:

    >> M=[-3 4; -1 2];

    M:

    >> c=M*m

    E :

    c =

    81 69 -46 -42 -74

    41 35 -12 -14 -24

    E :

    >> c = reshape(c,1,10)

    E :

    ans =

    81 41 69 35 -46 -12 -42 -14 -74 -24

    C 81, 41, 69, 35, 46, 12, 42, 14, 74, 24.

    N :

    M* =

    E M , , . E

    .

    D 81, 41, 69, 35, 46, 12, 42, 14, 74, 24.

    >> c=[81 41 69 35 -46 -12 -42 -14 -74 -24];

    R ( M):

    >> c = reshape(c,2,5);

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    19/23

    D M MATLAB:

    >> M=[-3 4; -1 2];

    H =M\:

    >> m=M\c;

    R :

    >> m=reshape(m,1,10)

    m =

    1 21 1 18 22 5 14 0 26 1

    R ( ):

    1 21 1 18 22 5 14 0 26 1

    EECC

    L MATLAB:1,9,10,22,24,43,16,37,53,24,36,56,16,28,44,37,17,34,21,18,20,25,18,31,1,20,20

    P ,

    1 0 10 1 10 1 2

     M 

     

    16. FC E()

    L MATLAB

    \.

    L A= :

    = (A,)

    E

    EE 4

    U 110 , , 1/8 1/9 1/5

    15. L 65. C ?

    L :

    1.  U 10 , :

    V + C + T = 110   V , C T .2.  1/8 1/9 1/5 15:

    (1/8)*V +(1/9)*C + (1/5)*T = 153.  L 65

    V + T = 65

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    20/23

    E A = B, :

    V  x C 

     

    E :

    ( ) ( ) ( )

    1* 1* 1* 110

    1 8 * 1 9 * 1 5 * 151* 0* 1* 65

    V C T 

    V C T V C T 

    + + =

    + + = + + =

    1 1 1 110

    1 8 1 9 1 5 * 151 0 1 65

    C T 

    =

     

    E MATLAB A B:

    >> A = [1 1 1; 1/8 1/9 1/5; 1 0 1];

    >> B = [110;15;65];

    Y :

    >> x = linsolve(A,B)

    S

    x =

    40

    45

    25

    E 40 , 45 25 .

    EE 5

    L 180. E 35 20 . H .

    L :

    4.  L 180.G + M + P = 180   G , M P .

    5.  E 35G = 35 + P   G P=35

    6.  E 20 P = 20 + (G M)   G + M + P = 20

    E A = B, :

    G x M 

     P 

     

    E :

    1* 1* 1* 1801* 0* 1* 351* 1* 1* 20

    G M P G M P G M P 

    + + = + − =

    − + + =

    1 1 1 1801 0 1 * 351 1 1 20

    G M  P 

    − =

     

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    21/23

    E MATLAB A B:

    >> A = [1 1 1; 1 0 -1; -1 1 1];

    >> B = [180;35;20];

    Y :

    >> x = linsolve(A,B)

    S

    x =

    80

    55

    45

    E 80, 55 45.

    EECC 2

    S :

    E 40 , , . L . E . A , .

    EE 6

    LEY DE KIRCHHOFF DE LA CORRIENTE: L .

    LEY DE KIRCHHOFF DEL VOLTAJE: L .

    U E ( ) , , .

    O . L .

    S E = 10 V 1 2 3

    3 , 4 5 R R y R= Ω = Ω = Ω  

    L :

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    22/23

    1.  L A . S . E:

    1 2 3  0i i i− − =  

    2.  L 1 L  .

    1 1 2 2 1 1 2 20 E R i R i R i R i E − − = → + =  

    3.  L 2 L  .

    3 3 2 2 2 2 3 30 0 R i R i R i R i− = → − + =  

    E A = B, :

    1

    2

    3

    i x i

    i

     

    E :

    1 2 3

    1 1 2 2 3

    1 2 2 3 3

    1* 1* 1* 0* * 0*

    0* * * 0

    i i i R i R i i E 

    i R i R i

    − − = + + = − + =

      1

    1 2 2

    2 3 3

    1 1 1 00 *

    00

    i R R i E 

     R R i

    − −   =  

      −  

     

    R 1 2 310 3 , 4 5 E V R R y R= = Ω = Ω = Ω :

    1

    2

    3

    1 1 1 03 4 0 * 100 4 5 0

    iii

    − −   =

     

    E MATLAB A B:

    >> A = [1 -1 -1; 3 4 0; 0 -4 5];

    >> B = [0;10;0];

    Y :

    >> x = linsolve(A,B)

    S

    x =

    1.9149

    1.0638

    0.8511

    E 1 2 31.9149 , 1.0638 , 0.8511i A i A i A= = =  

    EECCS :

    C 1 2 3, ,i i i   E = 6V

    1 2 3 43 , 5 , 4 2 R R R y R= Ω = Ω = Ω = Ω . 

  • 8/16/2019 Matlab sistemas de Matrices y Vectores

    23/23