How to create an n by n wilkinson matrix using diag

6 ビュー (過去 30 日間)
Colani Dlamini
Colani Dlamini 2019 年 9 月 16 日
コメント済み: Alejandra Lizarazo 2020 年 9 月 20 日
How to create an n by n wilkinson bidiagonal matrix
  5 件のコメント
Walter Roberson
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.
Alejandra Lizarazo
Alejandra Lizarazo 2020 年 9 月 20 日
I have the same problem, could you solve that?

サインインしてコメントする。

採用された回答

Bruno Luong
Bruno Luong 2019 年 9 月 19 日
n = 10;
W = spdiags([n:-1:1; n*ones(1,n)]',[0 1],n,n);
  1 件のコメント
Walter Roberson
Walter Roberson 2019 年 9 月 19 日
I believe that this is a homework assignment that specifically requires diag() be used.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by