Open just some Graph Edges in Variable Editor and let the user modify them?
2 ビュー (過去 30 日間)
古いコメントを表示
Giuseppe Antonio
2019 年 11 月 22 日
回答済み: Christine Tobler
2019 年 11 月 22 日
In order to show the user only a part of the graph, let's say only the edge number 1350, I use the following code:
openvar('G.Edges(1350,:)')
Afterwards when I direcly try to modify some values inside the Variable Editor, let's say the ColName value, I get the error:
"Direct editing of edges is not supported. Use addedge or rmedge instead".
I think this happens because the way the value is accessed is "G.Edges(1350, :).ColName" instead of "G.Edges.ColName(1350,:)".
The goal is to show only some edges in the Variable Editor and let the user modify them. Anyway, how can I solve the problem?
0 件のコメント
採用された回答
Christine Tobler
2019 年 11 月 22 日
That's tricky: In terms of assignment, if G.Edges(i, :) is assigned to, the graph class interprets this as assigning to all elements, including EndNodes, even if that property is not modified.
One approach would be to only open the properties of the edge in the variable editor, but not the first variable EndNodes:
>> openvar('G.Edges(1350,2:end)')
This will allow the value to be changed, but of course it will not display which edge is currently being changed.
You might provide some of that information in a bit of a roundabout fashion like this:
>> edge_1_3 = 4;
>> openvar('G.Edges(edge_1_3, 2:end)')
The variable name of the index into the edges is displayed at the top of the variable editor, which could be some indication to your user of which edge is currently being shown.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!