How can i write and use the attached matrix in MATLAB for any value of N
조회 수: 1 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/343600/image.png)
댓글 수: 1
Walter Roberson
2020년 8월 9일
That is clearly a homework assignment, so if we were to answer showing you how to create the matrix, we would have to deliberately make a long program.
답변 (1개)
Abdolkarim Mohammadi
2020년 8월 9일
편집: Abdolkarim Mohammadi
2020년 8월 9일
M = (n:-1:0) + (0:n)';
or
M = (n:2*n)' - (0:n);
댓글 수: 3
Abdolkarim Mohammadi
2020년 8월 9일
Sorry Walter. I wasn't aware of this. I agree with you that the best way of learning is trying to figure out the code.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!