How can I access the signals and parameters of un referenced or Local configuration model

I want to Access, the Signals, Parameter, States of a un-referenced model or local configuration model ,
How can i do that?

Answers (1)

Hi Manoj,
To access signals, parameters, and states in an unreferenced or local configuration model in Simulink, follow these methods:
  • Log Signals: Right click the signal, select Properties, and check 'log signal'. Use the Simulation Data Inspector to view them.
  • Programmatic Access: Use get_param and set_param to access and modify parameters:
param = get_param('model_name/block_name', 'ParameterName');
set_param('model_name/block_name', 'ParameterName', 'newValue');
  • Initial States: Use Simulink.BlockDiagram.getInitialState('model_name').
  • Workspace Export: In Configuration Parameters, enable 'States' and 'Signal logging' under Data Import/Export, and then run the simulation.
  • Use find_system to locate blocks and signals.
blocks = find_system('model_name', 'Type', 'Block');
Ensure that the model is loaded with load_system('model_name') if unreferenced.
For more information, refer to the following documentation links:
Hope this helps.

Categories

Asked:

on 18 Oct 2022

Answered:

on 4 Dec 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!