Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- W = [2 1 1 2 5 4 1 2 8 3 6 3 7 2 5 6];
- DG = sparse([1 1 2 2 2 3 3 3 4 4 4 5 5 6 6 7],[3 2 3 5 4 6 5 4 7 5 6 6 7 8 7 8],W,8,8)
- h= view(biograph(DG,[],'ShowWeights','on', 'ShowArrows','on'))
- [dist, path, pred] = graphshortestpath(DG,1,8)
- set(h.Nodes(path),'Color',[1 0.4 0.4])
- edges = getedgesbynodeid(h,get(h.Nodes(path),'ID'));
- set(edges,'LineColor',[1 0 0])
- set(edges,'LineWidth', 1.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement