Basics: Vectors and Matrices

      \ensuremath{\gg} A=[1 2 3; -1 0 2; 4 5 6]
     
     
     A =
     
          1     2     3
         -1     0     2
          4     5     6

      \ensuremath{\gg} B = [1 3 5]
     
     B =
     
          1     3     5

      \ensuremath{\gg} B'
     
     ans =
     
          1
          3
          5

      \ensuremath{\gg} X = A\ B'
     
     X =
     
         6.3333
        -9.6667
         4.6667

      \ensuremath{\gg} A*X
     
     ans =
     
         1.0000
         3.0000
         5.0000

      \ensuremath{\gg} A=rand(1000);
      \ensuremath{\gg} B=rand(1000,1);
      \ensuremath{\gg} X = A\ B;

      \ensuremath{\gg} error = max(abs(A*X-B))
     
     error =
     
       1.9213e-012

previous    contents     next

Peter Junglas 8.3.2000