Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Robert
Robert am 1 Nov. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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.

Antworten (0)

Diese Frage ist geschlossen.

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by