A Simulink.findVars equivalent for elements of a structure

5 views (last 30 days)
The parameters used in my Simulink model are organized into a many-level structure. I would like to find out which of the elements of that structure are being used by my model. Is there an existing tool for doing this?
It seems that Simulink.findVars won't look at individual structure elements but only at the structure as a whole, even with regular expression searching.
In case my intent is not clear, here are the details:
I have a large model that contains many referenced models, library-links, and masked blocks. My parameter structure is defined in the base workspace so as to be reachable by all of the referenced models. The structure contains many unused fields, which I would like to programmatically find and delete. The end result would ideally be a structure containing only fields used by the model.

Answers (1)

Chaitra Kulkarni
Chaitra Kulkarni on 2 Dec 2015
The capability to find blocks in a Simulink model that use a specific field of a structure as their parameter using findVars is not available in Simulink as of now.
To workaround the issue, you can store the struct variable in a new variable and then use the new variable in the block.

Community Treasure Hunt

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

Start Hunting!