-1 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0
-1 -1 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0
-1 -1 -1 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 0 0 0 0
-1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0 0 0
-1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 0 0 0 0 0 0 0 0 0

 採用された回答

Stephen23
Stephen23 2017 年 9 月 20 日

0 投票

Why use a loop?
>> M = zeros(10,14);
>> M(1:2:end,1:5) = -tril(ones(5));
>> M(2:2:end,1:5) = +tril(ones(5));

1 件のコメント

Jeong_evolution
Jeong_evolution 2017 年 9 月 20 日
excellent. thanks..
I think just use for loop...

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で 루프와 조건문 についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!