フィルターのクリア

How can I see the full matrix when I use spdiags() ?

1 回表示 (過去 30 日間)
LUCA GIROTTI
LUCA GIROTTI 2022 年 3 月 26 日
コメント済み: LUCA GIROTTI 2022 年 3 月 26 日
Hey there,
I am currently using the function spdiags and the outcome is the following:
An:
(1,1) 4
(2,1) -1
(1,2) -1
(2,2) 4
(3,2) -1
(2,3) -1
(3,3) 4
(4,3) -1
(3,4) -1
(4,4) 4
with this particular input : An = spdiags([- ones(n ,1) , 4* ones(n ,1) , - ones(n ,1)] , [ -1 , 0 , 1] , n , n)
Is there perhaps a way to see the full matrix instead of just this?
Thanks in advance!

採用された回答

Walter Roberson
Walter Roberson 2022 年 3 月 26 日
full(spdiags(TheSparseMatrix))
??
  1 件のコメント
LUCA GIROTTI
LUCA GIROTTI 2022 年 3 月 26 日
Thank you it works :)

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by