Hi, and Welcome,

On Mar 14, 2011, at 20:14 , Ben123 wrote:

> Hello. I'm a new user to Sage. I am trying to create a matrix without
> knowing the values when it is initialized. All the examples I see have
> static matrices like
> A = matrix(QQ,2,2,[2,1,1,2])
> My goal is to create a 2x2 matrix which I can then give values for
> later
> A[1][1]=5

That is correct, although I am at a loss to explain why that's how it is.

With your matrix, 
sage: A[1]
 (1, 2)

so clearly, the rows are "tuples", which are immutable.

Not all is lost, though:

sage: A[1,1]=5
sage: A 
[2 1]
[1 5]

Perhaps someone with a closer understanding of the implementation can explain 
the details.

HTH.

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
When LuteFisk is outlawed,
Only outlaws will have LuteFisk
--------



-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to