www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/HighlightGraphNodesExample.m

    %% Highlight Graph Nodes
% Create and plot a graph. Return a handle to the |GraphPlot| object, h.

% Copyright 2015 The MathWorks, Inc.

s = 1;
t = 2:6;
G = graph(s,t);
h = plot(G,'Layout','force')

%%
% Highlight nodes 1 and 3 by increasing their marker size.
highlight(h,[1 3])

%%
% Highlight nodes 1 and 3 by changing their color.
highlight(h,[1 3],'NodeColor','g')