Undefined function 'highlight' for input arguments of type 'digraph'
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
stam dadi
am 26 Jun. 2017
Kommentiert: Thais Uzun
am 5 Jul. 2017
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
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 26 Jun. 2017
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');
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!