I’m trying to extract a 5x5 part of a 1200x1500 matrix around the max of the matrix.
To find the max i use:
Max[DivdLight[[1]]]
and to find the corresponding row and column i use:
Position[DivdLight[[1]],Max[DivdLight[[1]]]
Now to get out a 5x5 about the max point i use:
DivdLight[1][[tx - 5 ;; tx + 5, ty - 5 ;; ty + 5]]
and i get the following error:
But if i put in the number, without call from the list like:
DivdLight[[1]][[481- 5 ;; 481 + 5, 835 - 5 ;; 835 + 5]]
then the code works as intended
do you guys have any idea why that’s the case? And if so help please
