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

조회 수: 1 (최근 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에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by