Documentation

simscape.logging.sli.findNode

Find Node object corresponding to block or subsystem

Syntax

node = simscape.logging.sli.findNode(simlog,block)

Description

example

node = simscape.logging.sli.findNode(simlog,block) returns a simscape.logging.Node object that contains the logged simulation data for the specified block or subsystem in a model. Before you call this function, you must load the model. You must also have the simulation log variable in your current workspace. Create the simulation log variable by simulating the model with data logging turned on, or load a previously saved variable from a file.

Examples

collapse all

Open the Permanent Magnet DC Motor example model, which already has data logging enabled, and run the simulation to create the simulation log variable simlog_ssc_dcmotor (as specified by the Workspace variable name model configuration parameter) in your current workspace:

ssc_dcmotor
sim('ssc_dcmotor');

Open the DC Motor subsystem and select the Inertia block.

Find node corresponding to the selected block:

n = simscape.logging.sli.findNode(simlog_ssc_dcmotor,gcbh)
n = 

  Node with properties:

    id: 'Inertia'
     w: [1x1 simscape.logging.Node]
     t: [1x1 simscape.logging.Node]
     I: [1x1 simscape.logging.Node]

n is the Node object corresponding to the selected block.

Open the Permanent Magnet DC Motor example model, which already has data logging enabled, and run the simulation to create the simulation log variable simlog_ssc_dcmotor (as specified by the Workspace variable name model configuration parameter) in your current workspace:

ssc_dcmotor
sim('ssc_dcmotor');

Find node corresponding to the Inertia block in the DC Motor subsystem:

n = simscape.logging.sli.findNode(simlog_ssc_dcmotor,'ssc_dcmotor/DC Motor/Inertia')
n = 

  Node with properties:

    id: 'Inertia'
     w: [1x1 simscape.logging.Node]
     t: [1x1 simscape.logging.Node]
     I: [1x1 simscape.logging.Node]

n is the Node object corresponding to the Inertia block in the DC Motor subsystem.

Find node corresponding to the DC Motor subsystem:

m = simscape.logging.sli.findNode(simlog_ssc_dcmotor,'ssc_dcmotor/DC Motor')
m = 

  Node with properties:

                                        id: 'DC_Motor'
                          Rotor_Resistance: [1x1 simscape.logging.Node]
                          Rotor_Inductance: [1x1 simscape.logging.Node]
    Rotational_Electromechanical_Converter: [1x1 simscape.logging.Node]
                                   Inertia: [1x1 simscape.logging.Node]
                                  Friction: [1x1 simscape.logging.Node]

m is the Node object corresponding to the whole DC Motor subsystem.

Input Arguments

collapse all

Simulation log workspace variable that contains the logged model simulation data, specified as a Node object. You specify the name of the simulation log variable by using the Workspace variable name parameter in the Simscape pane of the Configuration Parameters dialog box.

Block or subsystem name or identifier, specified as a handle, full path to a block or subsystem in the model, Simulink.Block object, or a valid Simulink identifier (SID).

Data Types: double | char

Output Arguments

collapse all

Node in the simulation data log tree corresponding to the specified block, returned as a Node object. The Node object, which is of class simscape.logging.Node, contains logged simulation data for the specified block. Returns empty [] if the node is not found.

Introduced in R2015a

Was this topic helpful?