Skip to content
Prev 315994 / 398513 Next

setting off-diagonals to zero

The statement

print((731:1095)[-SEQ])

does not remove the values of SEQ (i.e. 731 732 733 734 735 736) from the printed sequence, but instead uses SEQ to index into the vector created by 731:1095.  But the vector 731:1095 has length 365, so no elements are removed because the smallest value in SEQ is 731 and there are not many elements in the vector.


Hope this is helpful,

Dan

Daniel Nordlund
Bothell, WA USA