On Thu, Dec 1, 2011 at 3:17 PM, Chappman <chappman....@gmail.com> wrote: > Hi folks, > I am currently writing a code which uses a matrix in a > previously defined function written in the same sage window, but I > keep on getting this error message : TypeError: unable to coerce <type > 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'> to an > integer. > thank you for your time. > Kind Regards > Chappman > > my code is this : > > def U(N,M): > U=matrix(ZZ,N*M) > for i in range(N*M): > for j in range(N*M): > U[i,j]=1 > return U > > > def Q(N,M): > Q=matrix(ZZ,N*M) > for i in range(N*M): > for j in range(N*M): > Q[i,j]=U(N,M) > return Q
Maybe you want to use block_matrix? If so, type block_matrix? for syntax. (Possibly this is more of a sage-support question?) > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org