How can I solve this matrix problem?
이전 댓글 표시
답변 (2개)
Sulaymon Eshkabilov
2021년 6월 4일
0 개 추천
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일
0 개 추천
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.
카테고리
도움말 센터 및 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!
