When working with nxn matrix, writing a scalar (= a number if you name "numbers" matrix elements) like 'a' is the same than writing 'aI' where I is identity matrix with 1 in diagonal and 0 for other elements) or writing the diagonal matrix with a in diagonal and 0 for other elements)
addition M + a is addition for two matrix, result is matrix where elements of diagonal are elements of diagonal of M plus a. Other elements are unchanged adding to 0) multiplication aM is same than (aI)*M where * is multiplication operator between two nxn matrix, and from the definition of that operator, you get matrix where all elements of M have been multiplied by a j han aI *,gOn Sunday, 2 uly 2015 12:57:49UTC+2, avi kaur wrote: > > Hello > > I figured out that when we add a number to a matrix, It adds this > number to all the elements at diagonal of matrix. for example: > > sage: a > [ 1 2 2 6] > [ 4 6 2 5] > [56 7 4 8] > [ 8 3 9 6] > sage: a + 2 > [ 3 2 2 6] > [ 4 8 2 5] > [56 7 6 8] > [ 8 3 9 8] > > As you can see in above example. When we multiply or divide it with > some value, It processes all the elements of matrix but not in the > case of adding operation. > > > -- > Avi kaur > Blog: https://avikashyap620.wordpress.com > "There is no lacking of opportunity, The thing is you do not want to > see It -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.