MATLAB: Nested For Loop for 2D Matrix

nested for loops

I want to create a nested for loop that essentially goes through a 2D matrix of 600×1000 dimensions, such that in every loop in both of the dimensions it picks out exactly 51×51 part of the 2D matrix in either of the dimensions and multiplies it to another 51×51 separate matrix.

Best Answer

So then you want to extract random 51x51 submatrices? If so, then,
I=sort(randperm(600,51));
J=sort(randperm(1000,51));
submatrix= matrix(I,J);
Related Question