Divide matrix in subgroups

8 ビュー (過去 30 日間)
Fercho_Sala
Fercho_Sala 2021 年 4 月 15 日
コメント済み: Star Strider 2021 年 4 月 22 日
Hello everyone, just a simple question : having a matrix X ,how can I divide the total number of columns in 24 subgroups and each subgroup give a number as variable name? Thanks.

採用された回答

Star Strider
Star Strider 2021 年 4 月 15 日
The mat2cell function will likely do what you want.
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);
.
  14 件のコメント
Fercho_Sala
Fercho_Sala 2021 年 4 月 22 日
@Star Strider yes, analysis of data is another different thing, thanks a lot for your knowledge. :)
Star Strider
Star Strider 2021 年 4 月 22 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by