How to turn certain parts/blocks of a large matrix to zero while keeping the rest of the original matrix intact?
1 view (last 30 days)
Show older comments
Hi. I have a large weighted matrix, about 1000*7000 order. I need to turn certain blocks of this matrix (with known range of rows and columns) to zero, while keeping the rest of the matrix intact.
Any help will be highly appreciated.
Best regards, Shafique
0 Comments
Accepted Answer
the cyclist
on 21 Dec 2011
a = rand(1000,7000); % This represents your input array
a(1:3,6:9) = 0; % This zeros out the first three rows of columns 6 through 9.
a(1:10,1:10) % This shows the upper left corner of the array, to illustrate the zeroed out area.
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!