simscape.logging.findNode
Description
returns a node
= simscape.logging.findNode(simlog
,block
)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
Find Node for the Current 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_PermanentMagnetDCMotor
(as specified by the
Workspace variable name model configuration parameter) in your
current workspace:
openExample('simscape/PermanentMagnetDCMotorExample') sim('PermanentMagnetDCMotor');
Open the DC Motor subsystem and select the Inertia block.
Find node corresponding to the selected block:
n = simscape.logging.findNode(simlog_PermanentMagnetDCMotor,gcbh)
n = Node with properties: id: 'Inertia' savable: 1 exportable: 0 t: [1×1 simscape.logging.Node] w: [1×1 simscape.logging.Node] I: [1×1 simscape.logging.Node]
n
is the Node
object corresponding to the
selected block.
Find Node Using Full Block Path Name
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_PermanentMagnetDCMotor
(as specified by the
Workspace variable name model configuration parameter) in your
current workspace:
openExample('simscape/PermanentMagnetDCMotorExample') sim('PermanentMagnetDCMotor');
Find node corresponding to the Inertia block in the DC Motor subsystem:
n = simscape.logging.findNode(simlog_PermanentMagnetDCMotor,'PermanentMagnetDCMotor/DC Motor/Inertia')
n = Node with properties: id: 'Inertia' savable: 1 exportable: 0 t: [1×1 simscape.logging.Node] w: [1×1 simscape.logging.Node] I: [1×1 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.findNode(simlog_PermanentMagnetDCMotor,'PermanentMagnetDCMotor/DC Motor')
m = Node with properties: id: 'DC_Motor' savable: 1 exportable: 0 Rotor_Resistance: [1×1 simscape.logging.Node] Rotational_Electromechanical_Converter: [1×1 simscape.logging.Node] Inertia: [1×1 simscape.logging.Node] Rotor_Inductance: [1×1 simscape.logging.Node] Friction: [1×1 simscape.logging.Node]
m
is the Node
object corresponding to the
whole DC Motor subsystem.
Input Arguments
simlog
— Simulation log variable
Node
object
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
— Block name or identifier
handle | character vector | string scalar | Simulink.Block
object | SID
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
| string
Output Arguments
node
— Node in the simulation data log tree corresponding to the specified block
Node
object
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.
Version History
Introduced in R2020a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)