Re: [sage-support] matrix help

2011-12-02 Thread D. S. McNeil
> 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 U(N,M) is a function which returns a

[sage-support] matrix help

2011-12-02 Thread Chappman
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 to an integer. thank you for your time. Kind Regards Chappman my code is this : def U(N,M