フィルターのクリア

Undefined function 'highlight' for input arguments of type 'digraph'

4 ビュー (過去 30 日間)
stam dadi
stam dadi 2017 年 6 月 26 日
コメント済み: Thais Uzun 2017 年 7 月 5 日
Hi ,
I have a plot that contain a graph and I want to highlight a path between two nodes so I used the following:
plot(G);
v = shortestpath(G,'n','s');
highlight(G,v,'EdgeColor','r');
But I keep getting this error :
Undefined function 'highlight' for input arguments of type 'digraph'.
Error in PGM (line 26)
highlight(G,v,'EdgeColor','r');
Any solution for that ? thanks

採用された回答

Steven Lord
Steven Lord 2017 年 6 月 26 日
You highlight the graphics object created by calling plot on a graph or digraph, not the graph or digraph itself.
h = plot(G);
v = shortestpath(G,'n','s');
highlight(h,v,'EdgeColor','r');

その他の回答 (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