I have a 600x1000 dim 2D matrix and I want to use a nested for loop to index out a 51x51 matrix out of it. How can we do that? It has to be in a nested loop format of--
I actually tried your loop and the other non-loop suggestion, but the moment I put in my data set instead of rand, it gives me an error saying -- " Index in position 1 exceeds array bounds (must not exceed 1)."
So basically, I have to do something like this
for hh = 1:1000
for pp = 1:600
b(hh,pp) = lk.*filt; %lk is the original 600x1000 2D data and filt here is another 2D 51x51 2D matrix that I need to multiply the 51x51 chuncks of data from lk.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/490542-index-a-2d-matrix-from-a-2d-matrix#comment_766226
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/490542-index-a-2d-matrix-from-a-2d-matrix#comment_766226
Sign in to comment.