How to create an n by n wilkinson matrix using diag
조회 수: 9 (최근 30일)
이전 댓글 표시
How to create an n by n wilkinson bidiagonal matrix
댓글 수: 5
Walter Roberson
2019년 9월 18일
It looks like for the bidiagonal form, that the main diagonal should be n:-1:1 and that the diagonal to the right of it should be all n .
You can construct bidiagonal matrices by using diag() to construct each of the diagonals, and adding the matrices together.
채택된 답변
Bruno Luong
2019년 9월 19일
n = 10;
W = spdiags([n:-1:1; n*ones(1,n)]',[0 1],n,n);
댓글 수: 1
Walter Roberson
2019년 9월 19일
I believe that this is a homework assignment that specifically requires diag() be used.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!