37 views (last 30 days)

Show older comments

Star Strider
on 15 Apr 2021 at 12:38

Note that assigning each matrix to a different variable is not advisable. Keep them as the cell array, and refer to them as elements of it, using subscripts.

Dividing a (9x9) matrix into 9 (3x3) matrices would work as:

A = randi(9, 9);

Adiv = mat2cell(A, [1 1 1]*3, [1 1 1]*3);

.

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

Start Hunting!