I would like to define a function which produce matrices with variables. It will be something like the following.
def MatrixG(x,n,m):
r=Matrix(n,m)
for i in [0..n-1]:
for j in [0..m-1]:
r[i,j]=x[i,j]
return r
Here x[i,j]'s are variables. How to write the above correctly in Sage? Thank you very much.