www.gusucode.com > bioinfo 案例源码程序 matlab代码 > bioinfo/CreateABiographObjectAndCalculateNodePositionExample.m
%% Create a Biograph Object and Calculate Node Positions and Edge Trajectories % This example shows how to create a biograph object and calculate node % positions and edge trajectories. % Copyright 2015 The MathWorks, Inc. %% % Create a biograph 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]; bg = biograph(cm) %% % Nodes do not have positions yet. bg.nodes(1).Position %% % Call the layout engine and render the graph. dolayout(bg); bg.nodes(1).Position %% % view(bg) %% % Manually modify a node position and recalculate the paths only. bg.nodes(1).Position = [150 150]; dolayout(bg, 'Pathsonly', true); view(bg)