Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mathematica list output [closed]

Mathematica is giving me a weird output when I am asking for a specific element of a nested list.

I have:

testroots = {{0, 0, 0}, {0, 0, 0}}

When I ask for

testroots[[0,0]]

which should give me a 0, instead Mathematica says

Symbol

I don't understand why this is or what I've done wrong.

Thanks!

like image 862
Mary Avatar asked Mar 11 '26 02:03

Mary


1 Answers

Mathematica indices start with 1, not zero. So the [[0,0]] entry of testroots doesn't exist. You can get the first element using

testroots[[1, 1]]
like image 53
bill s Avatar answered Mar 13 '26 01:03

bill s



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!