Fast question!
조회 수: 9 (최근 30일)
이전 댓글 표시
댓글 수: 1
채택된 답변
Walter Roberson
2011년 11월 28일
If the output matrix is to be n by n, then
M = diag(ones(m-1,1),1) + diag(-ones(m-1,1),-1) + diag(1,1-n) + diag(1,n-1);
댓글 수: 1
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!