Hello,
On Thu, Oct 29, 2009 at 11:08 AM, Jo <[email protected]> wrote:
> t1=var('t1');
> m1=Matrix([[sin(t1)]]);
> m2=Matrix([[0]]);
> m2[0,0]=m1[0,0]; #error happen here.
> m2;
The issue is that m2 is a matrix with integer entries. Since sin(t1)
isn't an integer, you get a failure. When constructing the second
matrix, you can explicitly say what type the entries are. See the
following session:
sage: t1=var('t1');
sage: m1=Matrix([[sin(t1)]]);
sage: m2=Matrix([[0]]);
sage: m1.parent()
Full MatrixSpace of 1 by 1 dense matrices over Symbolic Ring
sage: m2.parent()
Full MatrixSpace of 1 by 1 dense matrices over Integer Ring
sage: sin(t1) in ZZ
False
sage: m3 = Matrix(SR,[[0]]);
sage: m3[0,0] = m1[0,0]
sage: m3
[sin(t1)]
--Mike
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---