How can I access the signals and parameters of un referenced or Local configuration model
Afficher commentaires plus anciens
I want to Access, the Signals, Parameter, States of a un-referenced model or local configuration model ,
How can i do that?
Réponses (1)
Shubham
le 4 Déc 2024
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:
- get_param: https://mathworks.com/help/releases/R2024b/simulink/slref/get_param.html
- set_param: https://mathworks.com/help/releases/R2024b/simulink/slref/set_param.html
- find_system: https://mathworks.com/help/releases/R2024b/simulink/slref/find_system.html
- Simulink.BlockDiagram.getInitialState: https://mathworks.com/help/releases/R2024b/simulink/slref/simulink.blockdiagram.getinitialstate.html
Hope this helps.
Catégories
En savoir plus sur Programmatic Model Editing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!