Effacer les filtres
Effacer les filtres

Finding tunable parameters used in Simulink model

5 vues (au cours des 30 derniers jours)
Connor Szczepaniak
Connor Szczepaniak le 21 Août 2017
Réponse apportée : Robert le 22 Août 2017
I'm trying to find every instance of the Simulink.Parameter class that is used in a Simulink model and their datatypes. Right now I'm doing so by looking in the base workspace for Simulink.Parameter instances and also using eval to find the datatypes. It's possible that there are parameters in the base workspace not referenced in the Simulink model, so is there a better way to do this?

Réponse acceptée

Robert
Robert le 22 Août 2017
I believe you are looking for Simulink.findVars. To find all the direct references to variables from the base workspace, try something like
varUse = Simulink.findVars(myModel, 'SourceType', 'base workspace')
To find the base workspace variables that aren't used in the model, and to avoid re-compiling the model after your last call to Simulink.findVars, try
unused = Simulink.findVars(myModel, 'FindUsedVars', false, 'SourceType', 'base workspace', 'SearchMethod', 'cached')
If you are looking for direct references to un-structured parameters, this should do the trick. To follow those references through Simulink masks or to decompose them when the parameters have structure values is a much more tricky problem, but maybe not one we need to tackle today. Is it?

Plus de réponses (0)

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by