Info

This question is closed. Reopen it to edit or answer.

How can I get a list of all user-settable Simulink model settings that are evaluated?

1 view (last 30 days)
How can I get a list of all user-settable Simulink model settings that are evaluated (strings that are executed as code to get the property value)?
I want this as part of my effort to programmatically find all base workspace variable references in the configuration settings of my Simulink model. For example, the property 'ExternalInput' references a Simulink Dataset in my base workspace. As far as this question is concerned, it would be just as well if it didn't reference that Dataset; what I really want is a list of all the model properties that could reference a variable.
So far, I know I can get all the model (let's call it my_model) properties with:
h = get_param(my_model, 'Handle');
properties = get(h);
allowed = set(h);
From these, I can search for properties whose values are strings and allowed to be anything. ( set returns an empty cell for these.)
fields = intersect(filenames(properties), fieldnames(allowed));
fields = fields(cellfun(@(f) ischar(properties.(f)) & is empty(allowed.(f)), fields));
But this still includes properties such as 'Name' and 'ToolBar' that are never evaluated and so don't matter in this context.

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!