How to turn certain parts/blocks of a large matrix to zero while keeping the rest of the original matrix intact?

2 次查看(过去 30 天)
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

采纳的回答

the cyclist
the cyclist 2011-12-21
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by