Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

2 ビュー (過去 30 日間)
Robert
Robert 2017 年 11 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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.

回答 (0 件)

この質問は閉じられています。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by