Matrix with gradually increasing!

1 次查看(过去 30 天)
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by