Matrix with gradually increasing!

5 ビュー (過去 30 日間)
Omar
Omar 2017 年 11 月 20 日
コメント済み: Omar 2017 年 11 月 20 日
Hi everyone! Can somebody help me to write a code to return a matrix with the following form: [1 1 1 1 1;1 1 1 1 0;1 1 1 0 0;1 1 0 0 0;1 0 0 0 0]? it's 5x5 square matrix Thanks in advance

採用された回答

John D'Errico
John D'Errico 2017 年 11 月 20 日
flip(tril(ones(5)))
ans =
1 1 1 1 1
1 1 1 1 0
1 1 1 0 0
1 1 0 0 0
1 0 0 0 0
  1 件のコメント
Omar
Omar 2017 年 11 月 20 日
You're awesome :) Thanks a lot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by