You would probably get better help if you put more time into asking your questions more clearly and *thoroughly*.
I for one usually avoid threads where questions are unclear or ambiguous because they often lead to a big waste of time. It's frustrating to spend time on explanations and answers, only to find that they're either ignored or irrelevant because the original poster didn't take the time to be more clear or provide important context.
Help us out. Help us help you. Describe what you're doing and why. Give some example data as input and show us what you want as output. And again, explain the purpose. Many posters here get stuck part way along the wrong path and wind up asking a too-narrowly-focused "wrong question". Often the best solution isn't to help them move farther down the wrong path. Rather, it's to identify a different better path altogether.
P.S. The first most obvious "red box" problem is that none of your matrix data or operations are inside the loop.
If it's just the red box you're confused about (as am I as I look at it, what are you doing?), the loop should encompass both your array manipulations. Then you remove the Index array, as if it's Autoindexed you'll get 1 row at a time inside the loop.
Thank You, I will try to improve the writing of the post further.
this is my main intention I have shown this without for loop and only for 0th index and 1st index, I want to do it till 4th index
This is I tried but was not able to get an updated max matrix RED BOX
If you want to convert a 4x5 array into 5 2x2 arrays and then take the maximum value by index of those 5 arrays...
Then I would take the maximum value of each column in the 4x5 array and then reshape the 4 resulting values into a 2x2 array:
I just gave kudos to RamonG for posting the exact same code I was about to post (so of course I like it), only quicker. The transpose allows for auto-indexing, and there's no need to reshape until after the loop.