필터 지우기
필터 지우기

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 CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by