specializing variables

13 views
Skip to first unread message

hw

unread,
Mar 20, 2014, 7:55:15 PM3/20/14
to sage-s...@googlegroups.com

I've defined some matrices with some variables using

a,b,c,d = var('a','b','c','d')
M=matrix(SR, [[a,b],[c,d]])
...

and manipulated them. Now I'd like to evaluate the result e.g. by setting a=0

Dima Pasechnik

unread,
Mar 21, 2014, 10:24:16 AM3/21/14
to sage-s...@googlegroups.com
No problem; use substitute. E.g.

sage: M=matrix(SR, [[a,b],[c,d]])
sage: M.substitute(a=0,b=a-b)
[ 0 a - b]
[ c d]

Reply all
Reply to author
Forward
0 new messages