Creating a stepped pattern of zeros in an array

Hello all,
I was hoping if anyone knows of a way to create the 'A' matrix consisting of 1s and 0s as shown below. I need to create a very large version of this example and was hoping to accomplish this without the use of loops.
A =
1 1 1 1
1 1 1 0
1 1 0 0
1 0 0 0
Thank you in advance for any help or tips,
Chris

 採用された回答

madhan ravi
madhan ravi 2019 年 4 月 3 日

0 投票

flip(tril(ones(4)))

1 件のコメント

Christopher
Christopher 2019 年 4 月 3 日
Perfect!
Thank you so much for your answer and very prompt response.
-Chris

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by