Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
stam dadi
stam dadi le 26 Juin 2017
Commenté : Thais Uzun le 5 Juil 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

Réponse acceptée

Steven Lord
Steven Lord le 26 Juin 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');

Plus de réponses (0)

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by