How to create a "model parameters" block in Simulink?

1 view (last 30 days)
Essentially, I need to recreate the "Model Parameters" block in commpccc (in the communications toolbox). It allows other users to quickly change the model parameters by accessing just one block. We don't want to have to change every value in every block, and we don't want an "initialization" .m -file either. I know this is done via the mask of an empty subsystem, but that's about as far I've got. All help is appreciated!

Answers (2)

Kaustubha Govind
Kaustubha Govind on 9 Jun 2014
Hatem: The model uses a pretty simple mechanism as you've found out already. The mask of the empty subsystem calls a MATLAB file commpccc_init in the Mask Initialization pane (run "which commpccc_init" to find the file), which creates the structure 'prmPccc' in the base workspace. This structure has fields that holds values relevant to various blocks. All blocks in the model refer to fields in this parameter structure.

Hatem
Hatem on 18 Jun 2014
Thanks for your help! I did spend some time on it, however, and wrote up the attached document for anyone who needs it. My main goal was to have a "self-contained" Simulink model, in other words to avoid using a .m-file to initialize the model. Note that this solution may not be the best and probably has its limitations, but solves my immediate issues. It is based off of the commpccc.slx example file provided by The Mathworks.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!