How can I solve this matrix problem?
2 ビュー (過去 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!
