> I mean for example:
>
> A = matrix(QQ,[[1,2,3],[4,5,6],[7,8,9]])
> A.submatrix([1,3],[1,3])
> ==> [1,3]
>       [7,9]

With a slightly different syntax, we can do this by passing a tuple of
values for the coordinates:

sage: A = matrix(QQ,[[1,2,3],[4,5,6],[7,8,9]])
sage: A
[1 2 3]
[4 5 6]
[7 8 9]
sage: A[(0,2), (0,2)]
[1 3]
[7 9]

I've used (0,2) instead of (1,3) because Python starts counting from 0
instead of 1.  I don't know how well stuff like this is documented,
though.  But I haven't read the docs as well as I should have, to be
honest-- usually I just try things and only read the docs when they
don't work. ;^)


Doug

-- 
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