I would use the lambda notation: sage: m = lambda x: matrix([[x[0],x[1]],[x[2],x[3]]]) sage: m([1,2,3,4])
[1 2] [3 4] sage: m([1,2,3,a]) [1 2] [3 a] sage: m([a,b,3,4]) [a b] [3 4] There might be better ways though. ++++++++++++++++++++++++++++++++++++++++ On 7/24/07, Roger Mason <[EMAIL PROTECTED]> wrote: > > Hello, > > Suppose I have a symbolic matrix: > > sage: m = matrix([[a,b],[d,e]]) > > and I wish to substitute some or all elements of m with numbers. > > The obvious > > sage: m.substitute(a=1) > > returns > > [a b] > [d e] > > so the substitution (which works fine on a list) does not work on a > matrix. > > How do I do such substitutions? > > Thanks, > > Roger > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---