get (biograph)

Retrieve information about biograph object

Syntax

get(BGobj)
BGStruct = get(BGobj)
PropertyValue = get(BGobj, 'PropertyName')
[Property1Value, Property2Value, ...] = get(BGobj, 'Property1Name', 'Property2Name', ...)

Input Arguments

BGobjBiograph object created with the function biograph.
PropertyNameProperty name for a biograph object.

Output Arguments

BGStructScalar structure, in which each field name is a property of a biograph object, and each field contains the value of that property.
PropertyValueValue of the property specified by PropertyName.

Description

get(BGobj) displays all properties and their current values of BGobj, a biograph object.

BGStruct = get(BGobj) returns all properties of BGobj, a biograph object, to BGStruct, a scalar structure, in which each field name is a property of a biograph object, and each field contains the value of that property.

PropertyValue = get(BGobj, 'PropertyName') returns the value of the specified property of BGobj, a biograph object.

[Property1Value, Property2Value, ...] = get(BGobj, 'Property1Name', 'Property2Name', ...) returns the values of the specified properties of BGobj, a biograph object.

Properties of a Biograph Object

PropertyDescription
ID Character vector to identify the biograph object. Default is ''.
LabelCharacter vector to label the biograph object. Default is ''.
DescriptionCharacter vector that describes the biograph object. Default is ''.
LayoutType

Character vector that specifies the algorithm for the layout engine. Choices are:

  • 'hierarchical' (default) — Uses a topological order of the graph to assign levels, and then arranges the nodes from top to bottom, while minimizing crossing edges.

  • 'radial' — Uses a topological order of the graph to assign levels, and then arranges the nodes from inside to outside of the circle, while minimizing crossing edges.

  • 'equilibrium' — Calculates layout by minimizing the energy in a dynamic spring system.

EdgeType

Character vector that specifies how edges display. Choices are:

  • 'straight'

  • 'curved' (default)

  • 'segmented'

Note

Curved or segmented edges occur only when necessary to avoid obstruction by nodes. Biograph objects with LayoutType equal to 'equilibrium' or 'radial' cannot produce curved or segmented edges.

Scale Positive number that post-scales the node coordinates. Default is 1.
LayoutScalePositive number that scales the size of the nodes before calling the layout engine. Default is 1.
EdgeTextColorThree-element numeric vector of RGB values. Default is [0, 0, 0], which defines black.
EdgeFontSizePositive number that sets the size of the edge font in points. Default is 8.
ShowArrowsControls the display of arrows with the edges. Choices are 'on' (default) or 'off'.
ArrowSizePositive number that sets the size of the arrows in points. Default is 8.
ShowWeightsControls the display of text indicating the weight of the edges. Choices are 'on' or 'off' (default).
ShowTextInNodes

Character vector that specifies the node property used to label nodes when you display a biograph object using the view method. Choices are:

  • 'Label' — Uses the Label property of the node object (default).

  • 'ID' — Uses the ID property of the node object.

  • 'None'

NodeAutoSize

Controls precalculating the node size before calling the layout engine. Choices are 'on' (default) or 'off'.

Note

Set it to off if you want to apply different node sizes by changing the Size property.

NodeCallbackUser-defined callback for all nodes. Enter the name of a function, a function handle, or a cell array with multiple function handles. After using the view function to display the biograph object in the Biograph Viewer, you can double-click a node to activate the first callback, or right-click and select a callback to activate. Default is the anonymous function, @(node) inspect(node), which displays the Property Inspector dialog box.
EdgeCallbackUser-defined callback for all edges. Enter the name of a function, a function handle, or a cell array with multiple function handles. After using the view function to display the biograph object in the Biograph Viewer, you can right-click and select a callback to activate. Default is the anonymous function, @(edge) inspect(edge), which displays the Property Inspector dialog box.
CustomNodeDrawFcnFunction handle to a customized function to draw nodes. Default is [].
NodesRead-only column vector with handles to node objects of a biograph object. The size of the vector is the number of nodes. For properties of node objects, see Properties of a Node Object.
EdgesRead-only column vector with handles to edge objects of a biograph object. The size of the vector is the number of edges. For properties of edge objects, see Properties of an Edge Object.

Examples

  1. Create a biograph object and assign the node IDs.

    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];
    ids = {'M30931','L07625','K03454','M27323','M15390'};
    bg = biograph(cm,ids);
    
  2. Use the get function to display the node IDs.

    get(bg.nodes,'ID')
    
    ans = 
    
        'M30931'
        'L07625'
        'K03454'
        'M27323'
        'M15390'
    
Introduced in R2008b