how to build a n*n weighted matrix

6 ビュー (過去 30 日間)
Mojtaba
Mojtaba 2024 年 2 月 27 日
コメント済み: Mojtaba 2024 年 3 月 2 日
one of the variable of our work is A. that is NxN weight matrix defining the (strongly connected) network. A(i,j) is the weight of the link i->j.
please show me how i create a NxN weight matrix based on real data (like variables of input output tables)

採用された回答

Steven Lord
Steven Lord 2024 年 2 月 27 日
Do you want to create the weighted adjacency matrix or do you want a digraph object that you can manipulate and analyze (asking for shortest path, distance between nodes, etc.)?
The "Edge List Graph Construction with Node Names and Edge Weights" or "Graph Construction with Tables" examples on that documentation page to which I linked above may give you a starting point for how to construct such a digraph that you can adapt to the specific format in which your data is stored.
And if you do just want the weighted adjacency matrix, if you build a digraph you can call the adjacency function on the object you built.
  1 件のコメント
Mojtaba
Mojtaba 2024 年 3 月 2 日
i wanna create the wighted anjancey matrix.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by