simscape.instrumentation.isLoggingEnabled
Description
Examples
Check Logging Status for Block
This example shows how to check whether logging is enabled for the
Ideal Torque Source block labeled Load
Torque
in the Permanent Magnet DC Motor example.
To open the model, enter:
openExample('simscape/PermanentMagnetDCMotorExample')
To get the default variable table for the Load Torque
block,
enter:
table1 = simscape.instrumentation.defaultVariableTable('PermanentMagnetDCMotor/Load Torque')
table1 = VariableTable (string ⟼ VariableConfiguration) with 5 variable(s): Name Unit Logging _________ _____ _______ C.w ⟼ <missing> rad/s false R.w ⟼ <missing> rad/s false S ⟼ <missing> N*m false t ⟼ <missing> N*m false w ⟼ <missing> rad/s false
To change the logging status of the t
variable,
enter:
table1("t").Logging = true
table1 = VariableTable (string ⟼ VariableConfiguration) with 5 variable(s): Name Unit Logging _________ _____ _______ C.w ⟼ <missing> rad/s false R.w ⟼ <missing> rad/s false S ⟼ <missing> N*m false t ⟼ <missing> N*m true w ⟼ <missing> rad/s false
To set table1
as the variable table for the Load
Torque
block,
enter:
simscape.instrumentation.setVariableTable('PermanentMagnetDCMotor/Load Torque',table1)
To confirm that the block has logging enabled, enter:
simscape.instrumentation.isLoggingEnabled('PermanentMagnetDCMotor/Load Torque')
ans = logical 1
Input Arguments
blockName
— Simscape block name
block name | block handle
Simscape block name, specified as a string scalar, character vector, or a handle.
Data Types: double
| char
| string
Output Arguments
result
— Logging status result
true | false
Logical true or false result when logging is enabled or disabled for the block,
respectively. Logical true and false correspond to 0
and
1
, respectively.
Version History
Introduced in R2024aR2024b: Check logging status
A Simscape block is now automatically enabled for logging when you select one or more of its variables for logging.
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)