How can I access the signals and parameters of un referenced or Local configuration model
Mostra commenti meno recenti
I want to Access, the Signals, Parameter, States of a un-referenced model or local configuration model ,
How can i do that?
Risposte (1)
Shubham
il 4 Dic 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.
Categorie
Scopri di più su Event Functions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!