Hi, can someone help me generate a square matrix with all its elements one, exept its diagonal? As the following
Show older comments
ans = 2 1 1 1 1 3 1 1 1 1 4 1 1 1 1 5
Accepted Answer
More Answers (0)
Categories
Find more on Operating on Diagonal Matrices 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!