11/10/11 1:44 PM           MATLAB Command Window                 1 of 8


>> A=[1,3,6;2,7,8;0,3,9]

A =

        1    3     6
        2    7     8
        0    3     9

>> size(A)

ans =

        3    3

>> A'

ans =

        1    2     0
        3    7     3
        6    8     9

>> A(:,A)
??? Subscript indices must either be real positive integers or
logicals.

>> A(:,3)

ans =

        6
        8
        9

>> A(1,:)

ans =

        1    3     6

>> A(:,1)+A(:,3)

ans =

       7
      10
       9

>> A(:,3)+A(:,1)

ans =

       7
      10
       9
11/10/11 1:44 PM                   MATLAB Command Window              2 of 8


>> A(1:,)+A(3:,)
??? A(1:,)+A(3:,)
         |
Error: Expression or statement is incorrect--possibly unbalanced (,
{, or [.

>> A(1,:)+A(3,:)

ans =

        1        6      15

>> B=[3,4,5;6,7,2;8,1,0]

B =

        3        4       5
        6        7       2
        8        1       0

>> C=A+B

C =

        4        7      11
        8       14      10
        8        4       9

>> C=A-B

C =

       -2       -1       1
       -4        0       6
       -8        2       9

>> C=A*B

C =

       69       31      11
      112       65      24
       90       30       6

>> C=A/B

C =

       1.3229        -0.3073   -0.1406
       1.5208         0.1979   -0.4688
       2.0938        -0.7344   -0.2344

>> C=A%B

C =
11/10/11 1:44 PM                   MATLAB Command Window   3 of 8


        1        3       6
        2        7       8
        0        3       9

>> C=(A*A)/B

C =

      18.4479        -4.1198   -2.9531
      30.0417        -5.1042   -5.4375
      23.4063        -6.0156   -3.5156

>> C=A*2

C =

        2        6      12
        4       14      16
        0        6      18

>> inv(A)

ans =

       1.8571        -0.4286   -0.8571
      -0.8571         0.4286    0.1905
       0.2857        -0.1429    0.0476

>> inv(A*B)

ans =

       0.0818        -0.0357   -0.0072
      -0.3690         0.1429    0.1052
       0.6176        -0.1786   -0.2512

>> det(A)

ans =

       21

>> rank(A)

ans =

        3

>> cond(A)

ans =

      35.9623

>> eye(A)
??? Error using ==> eye
11/10/11 1:44 PM                  MATLAB Command Window               4 of 8


Unknown command option.

>> eye(2)

ans =

        1     0
        0     1

>> eye(3)

ans =

        1     0      0
        0     1      0
        0     0      1

>> eye(12)

ans =

  Columns 1 through 11

        1     0      0     0        0    0     0     0    0   0   0
        0     1      0     0        0    0     0     0    0   0   0
        0     0      1     0        0    0     0     0    0   0   0
        0     0      0     1        0    0     0     0    0   0   0
        0     0      0     0        1    0     0     0    0   0   0
        0     0      0     0        0    1     0     0    0   0   0
        0     0      0     0        0    0     1     0    0   0   0
        0     0      0     0        0    0     0     1    0   0   0
        0     0      0     0        0    0     0     0    1   0   0
        0     0      0     0        0    0     0     0    0   1   0
        0     0      0     0        0    0     0     0    0   0   1
        0     0      0     0        0    0     0     0    0   0   0

  Column 12

        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        1

>> rand(3,3)

ans =

    0.8147        0.9134       0.2785
11/10/11 1:44 PM                    MATLAB Command Window   5 of 8


      0.9058        0.6324       0.5469
      0.1270        0.0975       0.9575

>> rand(2,3)

ans =

      0.9649        0.9706       0.4854
      0.1576        0.9572       0.8003

>> rand(3,3)

ans =

      0.1419        0.7922       0.0357
      0.4218        0.9595       0.8491
      0.9157        0.6557       0.9340

>> C=[1,3,9;6,7,2;8-1-2]
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.

>> C=[1,3,9;6,7,2;8,-1,-2]

C =

        1       3      9
        6       7      2
        8      -1     -2

>> trace(c)
??? Undefined function or variable 'c'.

>> trace(C)

ans =

        6

>> zeros(5,4)

ans =

        0       0      0     0
        0       0      0     0
        0       0      0     0
        0       0      0     0
        0       0      0     0

>> cond(eye(6))

ans =

        1

>> A[1 1;1 1+1e-6]
11/10/11 1:44 PM               MATLAB Command Window      6 of 8


??? A[1 1;1 1+1e-6]
     |
Error: Unbalanced or unexpected parenthesis or bracket.

>> A[1,1;1,1+1e-6]
??? A[1,1;1,1+1e-6]
     |
Error: Unbalanced or unexpected parenthesis or bracket.

>> cond(A)

ans =

      35.9623

>> A=[2,-1,0;-3,6,1]

A =

        2       -1    0
       -3        6    1

>> B=[1,0,-1,2;-4,3,1,0;0,3,1,-2]

B =

        1        0   -1    2
       -4        3    1    0
        0        3    1   -2

>> A'

ans =

        2       -3
       -1        6
        0        1

>> B'

ans =

        1       -4    0
        0        3    3
       -1        1    1
        2        0   -2

>> C=A*B

C =

        6       -3   -3    4
      -27       21   10   -8

>> C=B*A
??? Error using ==> mtimes
11/10/11 1:44 PM              MATLAB Command Window   7 of 8


Inner matrix dimensions must agree.

>> D=B*A
??? Error using ==> mtimes
Inner matrix dimensions must agree.

>> A=[-9,-18,;2,4]

A =

       -9   -18
        2     4

>> B=[2,3,1;-1,-6,7;4,5,-1]

B =

        2     3     1
       -1    -6     7
        4     5    -1

>> det(A')

ans =

        0

>> A'

ans =

       -9     2
      -18     4

>> B'

ans =

        2    -1     4
        3    -6     5
        1     7    -1

>> det(A)

ans =

        0

>> det(b)
??? Undefined function or variable 'b'.

>> det(B)

ans =

       42
11/10/11 1:44 PM                    MATLAB Command Window   8 of 8



>> a=[2,1,1;-5,-3,0;1,1,-1]

a =

        2        1        1
       -5       -3        0
        1        1       -1

>> b=[1,2,3;0,1,4;5,6,0]

b =

        1        2        3
        0        1        4
        5        6        0

>> inv(a)

ans =

      -3.0000         -2.0000   -3.0000
       5.0000          3.0000    5.0000
       2.0000          1.0000    1.0000

>> inv(b)

ans =

     -24.0000         18.0000    5.0000
      20.0000        -15.0000   -4.0000
      -5.0000          4.0000    1.0000

>>

5431305022

  • 1.
    11/10/11 1:44 PM MATLAB Command Window 1 of 8 >> A=[1,3,6;2,7,8;0,3,9] A = 1 3 6 2 7 8 0 3 9 >> size(A) ans = 3 3 >> A' ans = 1 2 0 3 7 3 6 8 9 >> A(:,A) ??? Subscript indices must either be real positive integers or logicals. >> A(:,3) ans = 6 8 9 >> A(1,:) ans = 1 3 6 >> A(:,1)+A(:,3) ans = 7 10 9 >> A(:,3)+A(:,1) ans = 7 10 9
  • 2.
    11/10/11 1:44 PM MATLAB Command Window 2 of 8 >> A(1:,)+A(3:,) ??? A(1:,)+A(3:,) | Error: Expression or statement is incorrect--possibly unbalanced (, {, or [. >> A(1,:)+A(3,:) ans = 1 6 15 >> B=[3,4,5;6,7,2;8,1,0] B = 3 4 5 6 7 2 8 1 0 >> C=A+B C = 4 7 11 8 14 10 8 4 9 >> C=A-B C = -2 -1 1 -4 0 6 -8 2 9 >> C=A*B C = 69 31 11 112 65 24 90 30 6 >> C=A/B C = 1.3229 -0.3073 -0.1406 1.5208 0.1979 -0.4688 2.0938 -0.7344 -0.2344 >> C=A%B C =
  • 3.
    11/10/11 1:44 PM MATLAB Command Window 3 of 8 1 3 6 2 7 8 0 3 9 >> C=(A*A)/B C = 18.4479 -4.1198 -2.9531 30.0417 -5.1042 -5.4375 23.4063 -6.0156 -3.5156 >> C=A*2 C = 2 6 12 4 14 16 0 6 18 >> inv(A) ans = 1.8571 -0.4286 -0.8571 -0.8571 0.4286 0.1905 0.2857 -0.1429 0.0476 >> inv(A*B) ans = 0.0818 -0.0357 -0.0072 -0.3690 0.1429 0.1052 0.6176 -0.1786 -0.2512 >> det(A) ans = 21 >> rank(A) ans = 3 >> cond(A) ans = 35.9623 >> eye(A) ??? Error using ==> eye
  • 4.
    11/10/11 1:44 PM MATLAB Command Window 4 of 8 Unknown command option. >> eye(2) ans = 1 0 0 1 >> eye(3) ans = 1 0 0 0 1 0 0 0 1 >> eye(12) ans = Columns 1 through 11 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 Column 12 0 0 0 0 0 0 0 0 0 0 0 1 >> rand(3,3) ans = 0.8147 0.9134 0.2785
  • 5.
    11/10/11 1:44 PM MATLAB Command Window 5 of 8 0.9058 0.6324 0.5469 0.1270 0.0975 0.9575 >> rand(2,3) ans = 0.9649 0.9706 0.4854 0.1576 0.9572 0.8003 >> rand(3,3) ans = 0.1419 0.7922 0.0357 0.4218 0.9595 0.8491 0.9157 0.6557 0.9340 >> C=[1,3,9;6,7,2;8-1-2] ??? Error using ==> vertcat CAT arguments dimensions are not consistent. >> C=[1,3,9;6,7,2;8,-1,-2] C = 1 3 9 6 7 2 8 -1 -2 >> trace(c) ??? Undefined function or variable 'c'. >> trace(C) ans = 6 >> zeros(5,4) ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> cond(eye(6)) ans = 1 >> A[1 1;1 1+1e-6]
  • 6.
    11/10/11 1:44 PM MATLAB Command Window 6 of 8 ??? A[1 1;1 1+1e-6] | Error: Unbalanced or unexpected parenthesis or bracket. >> A[1,1;1,1+1e-6] ??? A[1,1;1,1+1e-6] | Error: Unbalanced or unexpected parenthesis or bracket. >> cond(A) ans = 35.9623 >> A=[2,-1,0;-3,6,1] A = 2 -1 0 -3 6 1 >> B=[1,0,-1,2;-4,3,1,0;0,3,1,-2] B = 1 0 -1 2 -4 3 1 0 0 3 1 -2 >> A' ans = 2 -3 -1 6 0 1 >> B' ans = 1 -4 0 0 3 3 -1 1 1 2 0 -2 >> C=A*B C = 6 -3 -3 4 -27 21 10 -8 >> C=B*A ??? Error using ==> mtimes
  • 7.
    11/10/11 1:44 PM MATLAB Command Window 7 of 8 Inner matrix dimensions must agree. >> D=B*A ??? Error using ==> mtimes Inner matrix dimensions must agree. >> A=[-9,-18,;2,4] A = -9 -18 2 4 >> B=[2,3,1;-1,-6,7;4,5,-1] B = 2 3 1 -1 -6 7 4 5 -1 >> det(A') ans = 0 >> A' ans = -9 2 -18 4 >> B' ans = 2 -1 4 3 -6 5 1 7 -1 >> det(A) ans = 0 >> det(b) ??? Undefined function or variable 'b'. >> det(B) ans = 42
  • 8.
    11/10/11 1:44 PM MATLAB Command Window 8 of 8 >> a=[2,1,1;-5,-3,0;1,1,-1] a = 2 1 1 -5 -3 0 1 1 -1 >> b=[1,2,3;0,1,4;5,6,0] b = 1 2 3 0 1 4 5 6 0 >> inv(a) ans = -3.0000 -2.0000 -3.0000 5.0000 3.0000 5.0000 2.0000 1.0000 1.0000 >> inv(b) ans = -24.0000 18.0000 5.0000 20.0000 -15.0000 -4.0000 -5.0000 4.0000 1.0000 >>