Creation of matrices (24,72) M1&M2 ?
10 ビュー (過去 30 日間)
古いコメントを表示
Hello. I want to create matrices (24,72) that have the following forms:

0 件のコメント
採用された回答
Stephen23
2016 年 2 月 2 日
編集済み: Stephen23
2016 年 2 月 3 日
C1 = repmat({[1,1,0]},1,24);
M1 = blkdiag(C1{:});
And the second is either:
M2 = circshift(M1,[0,1]);
or
C2 = repmat({[0,1,1]},1,24);
M2 = blkdiag(C2{:});
2 件のコメント
Stephen23
2016 年 2 月 3 日
Another simple method is to use eye, zeros and reshape:
M1 = reshape([eye(24);eye(24);zeros(24)],24,72);
M2 = reshape([zeros(24);eye(24);eye(24)],24,72);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!