How to find a variable in Simulink Model
Show older comments
I want to know the variable uses in demo sldemo_mdlref_datamngt.mdl.here assume in counter2 ,right click and if u see Model Reference Parameter there are two variables Params, ICs under Model argument values (for this instance).Can I know what it is and what are its values.I read help in Simulink but could not get relevant answer .On what basis these variables arte passed
Accepted Answer
More Answers (3)
wondful answer,to search under reference,i modified like this:
varObj = Simulink.VariableUsage(varNames,'base workspace');
unusedVars = Simulink.findVars(modelname,varObj,...
'FindUsedVars','off','SearchReferencedModels','on');
1 Comment
ahmed
on 8 Oct 2024
best answer
Omid Saber
on 23 Jan 2020
0 votes
You can do what Sebastian said to find where the parameters are used. But if you're looking for the valuesor how that parameter is initiated, you should look under the mask. For this, if the mask is linked to a library either got to the library block or break the link to library and work locally on the mask. Right click on the mask and click on Mask>Edit Mask. In the opened window go to the Initilization tabThat's where the parameters are locally defined and you can edit them.
Jerry Korulla George
on 10 Apr 2025
0 votes
Here is a matlab app that I created for the same: https://github.com/jerrykorulla/SimulinkVariablesInspector/
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!