Resolução do problema em MATLAB 

 

This is a Classroom License for instructional use only.

Research and commercial use is prohibited.

 

To get started, select "MATLAB Help" from the Help menu.

 

>> A=[7 8 1;6 4 3;5 5 7]

 

A =

 

     7     8     1

     6     4     3

     5     5     7

 

>> b=[25;30;40]

 

b =

 

    25

    30

    40

 

>> x=A\b

 

x =

 

    3.5217

   -0.3913

    3.4783

 

>> A*x

 

ans =

 

    25

    30

    40

 

>> L=[0 0 0;-6 0 0;-5 -5 0]

 

L =

 

     0     0     0

    -6     0     0

    -5    -5     0

 

>> U=[0 -8 -1;0 0 -3;0 0 0]

 

U =

 

     0    -8    -1

     0     0    -3

     0     0     0

 

>> D=[7 0 0;0 4 0;0 0 7]

 

D =

 

     7     0     0

     0     4     0

     0     0     7

 

>> C=inv(D)*(L+U)

 

C =

 

         0   -1.1429   -0.1429

   -1.5000         0   -0.7500

   -0.7143   -0.7143         0

 

>> help norm

 

 NORM   Matrix or vector norm.

    For matrices...

      NORM(X) is the largest singular value of X, max(svd(X)).

      NORM(X,2) is the same as NORM(X).

      NORM(X,1) is the 1-norm of X, the largest column sum,

                      = max(sum(abs((X)))).

      NORM(X,inf) is the infinity norm of X, the largest row sum,

                      = max(sum(abs((X')))).

      NORM(X,'fro') is the Frobenius norm, sqrt(sum(diag(X'*X))).

      NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'.

 

    For vectors...

      NORM(V,P) = sum(abs(V).^P)^(1/P).

      NORM(V) = norm(V,2).

      NORM(V,inf) = max(abs(V)).

      NORM(V,-inf) = min(abs(V)).

 

    See also COND, RCOND, CONDEST, NORMEST.

 

>> norm (C)

 

ans =

 

    1.8480

 

>> help norm

 

 NORM   Matrix or vector norm.

    For matrices...

      NORM(X) is the largest singular value of X, max(svd(X)).

      NORM(X,2) is the same as NORM(X).

      NORM(X,1) is the 1-norm of X, the largest column sum,

                      = max(sum(abs((X)))).

      NORM(X,inf) is the infinity norm of X, the largest row sum,

                      = max(sum(abs((X')))).

      NORM(X,'fro') is the Frobenius norm, sqrt(sum(diag(X'*X))).

      NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'.

 

    For vectors...

      NORM(V,P) = sum(abs(V).^P)^(1/P).

      NORM(V) = norm(V,2).

      NORM(V,inf) = max(abs(V)).

      NORM(V,-inf) = min(abs(V)).

 

    See also COND, RCOND, CONDEST, NORMEST.

 

>> norm(C,1)

 

ans =

 

    2.2143

 

>> norm(C,inf)

 

ans =

 

    2.2500

 

>> help eing

 

eing.m not found.

 

>> eig(C)

 

ans =

 

   -1.6759

    1.3335

    0.3425

 

>> [v,d]=eig(C)

 

v =

 

    0.5132    0.6457   -0.4514

    0.6886   -0.7611    0.0238

    0.5122    0.0618    0.8920

 

 

d =

 

   -1.6759         0         0

         0    1.3335         0

         0         0    0.3425

 

Pagina anterior

Hosted by www.Geocities.ws

1