After running a program I developed, I am analyzing part of it and get an output of,
2 List
What does the "List" mean here? I've searched the documentation with no answer found.
Fred,
nPP[[0]] is equivalent to Part[nPP, 0]. There might be a way to alter the definition of the built-in Part function to do what you want. A much simpler solution would be to shift the index values by one. Store the sum in nPP[[1]] , why does it have to be at nPP[[0]]?
nPP[[0]]
Part[nPP, 0]
Part
nPP[[1]]
Hi Rohit,
Thanks. Just for convenience of later programming. There are 720 indices. I suppose I could shift everything by 1 and make it 721. I will give it a shot.
Thanks. I think I got it. It was actually this with 720 list length for both
nPP[[0]] + nNN[[0]]
So I guess the "2" is there because there is two elements in the sum and "List" is there because there is nothing in the two Lists at 0. Does that sound correct?
Hi Fred,
Not exactly, expr[[0]] evaluates to the Head of expr, which is List in your example, not "nothing".
expr[[0]]
Head
expr
List
List + List (* 2 List *) (a*b)[[0]] + Sqrt[2][[0]] (* Power + Times *)
Perhaps it is something like this
vector={3,4,5}; 2*vector[[0]]
which returns
when
2*vector[[1]]
returns
6
because vector subscripts start at 1 in Mathematica and the 0'th element is the Head, which is List in this case.