フィルターのクリア

how do i print this matrix?

2 ビュー (過去 30 日間)
Ann Lee
Ann Lee 2022 年 4 月 1 日
回答済み: Stephen23 2022 年 4 月 1 日
hi!
i want to print this matrix..
i think there is a easy pattern in this matrix but i couldn't found..!
Is there a easy way to create this matrix?

採用された回答

KSSV
KSSV 2022 年 4 月 1 日
A = zeros(6,5) ;
A(1:3,1:3) = 1 ;
A(:,4) = [1 0 0 1 1 1]' ;
A(:,5) = [1 0 0 1 1 1]' ;
A
A = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1
  1 件のコメント
Ann Lee
Ann Lee 2022 年 4 月 1 日
thank you again!!!!!! have a good day!!

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

その他の回答 (1 件)

Stephen23
Stephen23 2022 年 4 月 1 日
M = repelem([1,1;1,0;0,1],[1,2,3],[3,2])
M = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by