I did divide array with 2D into small boxes 2D also,the problem is how to get each box into sequential blocks.

조회 수: 2 (최근 30일)
I did divide array of (32,32) into boxes with (8,8) so I got 16 box. I need to get those boxes into sequential block for instance : b where (i=1,2,...,16). when i start to allocate memory for it as
for i=1:16, b(i)=zeros(8,8); end
I stack there , please help me with that.

답변 (1개)

Mischa Kim
Mischa Kim 2014년 5월 1일
Sundus, you could use cell arrays
data = eye(32);
b = mat2cell(data,8*ones(1,4),8*ones(1,4));
Access the individual submatrices via b{1,2}, for example.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by