matrices/script.rst
changeset 307 1a73dddb1d05
parent 287 d9507624eb8f
child 319 e8c02b3c51ac
equal deleted inserted replaced
306:f105cfcc2498 307:1a73dddb1d05
    20 
    20 
    21 Welcome to the spoken tutorial on Matrices.
    21 Welcome to the spoken tutorial on Matrices.
    22 
    22 
    23 {{{ switch to next slide, outline slide }}}
    23 {{{ switch to next slide, outline slide }}}
    24 
    24 
    25 In this tutorial we will learn about matrices, creating matrices and
    25 In this tutorial we will learn about matrices, creating matrices using
    26 matrix operations.
    26 direct data, by converting a list, matrix operations. Finding inverse
       
    27 of a matrix, determinant of a matrix, eigen values and eigen vectors
       
    28 of a matrix, norm and singular value decomposition of matrices.
    27 
    29 
    28 {{{ creating a matrix }}}
    30 {{{ creating a matrix }}}
    29 
    31 
    30 All matrix operations are done using arrays. Thus all the operations
    32 All matrix operations are done using arrays. Thus all the operations
    31 on arrays are valid on matrices also. A matrix may be created as,
    33 on arrays are valid on matrices also. A matrix may be created as,
    86 function ``multiply()``
    88 function ``multiply()``
    87 ::
    89 ::
    88 
    90 
    89     multiply(m3,m2)
    91     multiply(m3,m2)
    90 
    92 
       
    93 {{{ switch to next slide, Matrix multiplication (cont'd) }}}
       
    94 
    91 Now let us see an example for matrix multiplication. For doing matrix
    95 Now let us see an example for matrix multiplication. For doing matrix
    92 multiplication we need to have two matrices of the order n by m and m
    96 multiplication we need to have two matrices of the order n by m and m
    93 by r and the resulting matrix will be of the order n by r. Thus let us
    97 by r and the resulting matrix will be of the order n by r. Thus let us
    94 first create two matrices which are compatible for multiplication.
    98 first create two matrices which are compatible for multiplication.
    95 ::
    99 ::
   106 thus unlike in array object ``star`` can be used for matrix multiplication
   110 thus unlike in array object ``star`` can be used for matrix multiplication
   107 in matrix object.
   111 in matrix object.
   108 
   112 
   109 {{{ switch to next slide, recall from arrays }}}
   113 {{{ switch to next slide, recall from arrays }}}
   110 
   114 
   111 As we already saw in arrays, the functions ``identity()``,
   115 As we already saw in arrays, the functions ``identity()`` which
   112 ``zeros()``, ``zeros_like()``, ``ones()``, ``ones_like()`` may also be
   116 creates an identity matrix of the order n by n, ``zeros()`` which
   113 used with matrices.
   117 creates a matrix of the order m by n with all zeros, ``zeros_like()``
   114 
   118 which creates a matrix with zeros with the shape of the matrix passed,
   115 {{{ switch to next slide, matrix operations }}}
   119 ``ones()`` which creates a matrix of order m by n with all ones,
       
   120 ``ones_like()`` which creates a matrix with ones with the shape of the
       
   121 matrix passed. These functions can also be used with matrices.
       
   122 
       
   123 {{{ switch to next slide, more matrix operations }}}
   116 
   124 
   117 To find out the transpose of a matrix we can do,
   125 To find out the transpose of a matrix we can do,
   118 ::
   126 ::
   119 
   127 
   120     print m4
   128     print m4
   176 we do,
   184 we do,
   177 ::
   185 ::
   178 
   186 
   179     norm(im5)
   187     norm(im5)
   180 
   188 
   181 Euclidean norm is also called Frobenius norm.
       
   182 
       
   183 And to find out the Infinity norm of the matrix im5, we do,
   189 And to find out the Infinity norm of the matrix im5, we do,
   184 ::
   190 ::
   185 
   191 
   186     norm(im5,ord=inf)
   192     norm(im5,ord=inf)
   187 
   193