Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to create this MATLAB matrix?
조회 수: 1 (최근 30일)
이전 댓글 표시
Write some lines of MATLAB code that use nested for loops to produce a N by N (square) matrix A with 0's down the main diagonal, 1's in the entries just above and below the main diagonal, 2's above and below that, etc. User will enter the value of N at the run time. The matrix should look like this depending upon the value of N.
[0 1 2 3 4 5; 1 0 1 2 3 4; 2 1 0 1 2 3; 3 2 1 0 1 2; 4 3 2 1 0 1; 5 4 3 2 1 0]
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!