How can I solve this matrix problem?
1 次查看(过去 30 天)
显示 更早的评论
回答(2 个)
Sulaymon Eshkabilov
2021-6-4
You can start working with eye() and rot90()
Then you can try with for loop, i.e. [for .. end] and [while .. end]
Jonas
2021-6-4
Use a for-loop which goes from 1:n over the two dimensions, and use an if-statement to write a 1 and an else statement to write a 0, pending on if we comply with being on that diagonal.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!