MATLAB: How to change edge color of ‘biograph’ object

MATLAB

Is there a function similar to "highlight" that I can use for 'biograph' object?

Best Answer

You can modify the color of the edge by modifying the "edges" property of the object:
cm = [0 1 1 0 0;
1 0 0 1 1;
1 0 0 0 0;
0 0 0 0 1;
1 0 1 0 0];
bg1 = biograph(cm)
% node 4 -> 5
row = 4;
column = 5;
% Use this to modify the color for an edge
idx = (row-1)*size(cm,1) + column
cm1 = reshape(cm',[1,numel(cm)]);
i = sum(cm1(1:idx))
bg1.edges(i).LineColor = [1 0 0];
view(bg1)