Clear Filters
Clear Filters

list all variable literals used in a model

1 view (last 30 days)
Jürgen on 12 Jan 2018
Hello! I want to know all variable-literals needed to operate in a Simulink model. When you google for this subject you get advised to read the documentation of Simulink.findVars. However Simulink.findVars analyzes a model that is already initialized and compiled to an object in memory. All the necessary variables must be already preset in some memory scopes (base- or model-workspace or data-dictionary or mixture of these…). The situation that I target is different. I have a new big model without any variables initialized (all above variable-scopes completely empty). I could now click through all blocks of my model and copy all variable literals found in block-interfaces, masks,… . Is there a way to get the corresponding list of variable-literals by a simple command? I already thought about something funny like trying(try-catch) to run the uninitialized model / fetch and analyze the errors thrown / create dummy variables in base / … and finally use ‘myVarList =who; ’… . This approach might run into difficulties and get very complicated because most likely the compilation process might check the variable type of the dummy variables… and a lot of additional work might be necessary – if such an approach should work at all. Thank you! Jürgen Müller

Answers (0)


Community Treasure Hunt

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

Start Hunting!