randMatrix and randomness in general in live.sympy.org

14 views
Skip to first unread message

Raúl Romero

unread,
Dec 12, 2016, 6:58:38 PM12/12/16
to sympy
I have seen that when I input:
>> A = randMatrix(3,3)         (for example)
and after that I call A
>> A
A changes continuously.
How can I get a random matrix (or number) that get fixed for using it from then on?
Thanks.

Aaron Meurer

unread,
Dec 12, 2016, 7:12:24 PM12/12/16
to sy...@googlegroups.com
Unfortunately, the way SymPy currently works, it doesn't actually
store variables. It reexecutes previous inputs. The workaround here,
for SymPy Live, is to copy the result of str(A) and paste it as A, so
that it evaluates to the same thing. This won't be an issue in a
normal Python session.

This is something that we would like to fix, by the way, if anyone is
interested in working on SymPy Live.

Aaron Meurer
> --
> 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 sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/06301465-2572-40a9-868a-d2f5bcb19972%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages