How to store graphs (undirected) i cell array and retrieve them

5 ビュー (過去 30 日間)
Arek
Arek 2022 年 1 月 20 日
回答済み: Arek 2022 年 1 月 20 日
I am writting an algorithm based on graph. In the process I am creating and modifying undirected graphs. It is mostly performed in the for loop so I thought I can store them in cell array like this:
graphCellArray(i) = {myGraph};
The problem appears when I want to retrieve it from graphCellArray. How can I do it ? Or maybe I should use some other methods?

採用された回答

Yongjian Feng
Yongjian Feng 2022 年 1 月 20 日
You meant:
graphCellArray = {g1, g2, g3};
graphCellArray{1} % access the first one

その他の回答 (1 件)

Arek
Arek 2022 年 1 月 20 日
Yesss, thank you :)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by