How to create a matrix?
1 view (last 30 days)
Show older comments
Hi all, I am trying to create a matrix (101x101) like this :
Can anyone help me with the code please?
0 Comments
Accepted Answer
Azzi Abdelmalek
on 2 Apr 2016
Edited: Azzi Abdelmalek
on 2 Apr 2016
n=4 % in your case use n=101
out=tril(2*ones(n),-1)
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!