I can't create a graph from the adjacency matrix

3 ビュー (過去 30 日間)
Emanuele Giacomuzzo
Emanuele Giacomuzzo 2020 年 11 月 24 日
コメント済み: Emanuele Giacomuzzo 2020 年 11 月 25 日
Hi, I'm trying to create an undirected graph from my adjacency matrix. This is my code:
undirected_graph=graph(undirected_network);
The error I receive is the following one:
Error using digraph/subsref (line 8)
Unsupported graph indexing.
The adjacency matrix is symmetric (I tested it with the function issymmetric) and its diagonal values are all zero (the graph has no loops).
  1 件のコメント
Stephan
Stephan 2020 年 11 月 24 日
could you provide the matrix?

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

採用された回答

Steven Lord
Steven Lord 2020 年 11 月 24 日
I suspect you've created a digraph object and stored it in a variable named graph, which will prevent you from calling the graph function to create a graph object. Rename that variable.
  1 件のコメント
Emanuele Giacomuzzo
Emanuele Giacomuzzo 2020 年 11 月 25 日
You were right. Thank so much!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by