"Unable to perform assignment..." Indices size error

1 回表示 (過去 30 日間)
Connor McGrath
Connor McGrath 2020 年 8 月 4 日
コメント済み: Connor McGrath 2020 年 8 月 4 日
Hi everyone. I'm writing a code for the Google PageRank algortihm and am getting an indices size error. I understand that this means that the code is trying to replace a row/colum with too many variables however the code that is giving me the error was given by my instructor and I dont entirely understand what is going on. I've attached the code below, any insight on how to solve the issue would be appreciated. Thanks!

採用された回答

Rik
Rik 2020 年 8 月 4 日
The source of the issue is a bit earlier in the code: the code that is supposed to find the dominant eigenvalue doesn't work as it should. The code below simply finds the value that is closest to 1, instead of assuming it will be almost 1.
[~,ind]=min(abs(sum(real(D))-1));
With this modification, the final output exists and makes sense to me.
  1 件のコメント
Connor McGrath
Connor McGrath 2020 年 8 月 4 日
That did it, Thanks!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by