This is probably a bug.  The code you provided should work as expected.  In
general the connection between MatrixExprs and scalar Exprs is rough.


On Mon, Jan 13, 2014 at 2:42 AM, Dee Mee <[email protected]> wrote:

> from sympy import MatrixSymbol, ImmutableMatrix
>
> u = MatrixSymbol('u', 2,1)
>
> print "\n\ntest1:"
> print  u.subs(u, ImmutableMatrix([3,5]))[0,0]
>
> print "\n\ntest2:"
> print  u[0,0].subs(u, ImmutableMatrix([3,5]))
>
> print "\n\ntest3:"
> print  u[0,0].subs(u, ImmutableMatrix([3,5])).evalf()
>
>
> Here is whet this code prints:
> test1:
> 3
>
>
> test2:
> Matrix([
> [3],
> [5]])[0, 0]
>
>
> test3:
> Matrix([
> [3],
> [5]])[0, 0]
>
>
>
> I expected the same output in all tests. At least in the 3rd test the
> result should be 3.
> Why this expresion is not evaluated? How to evaluate it?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to