MATLAB Answers

nkumar
0

How to find a variable in Simulink Model

Asked by nkumar
on 8 Jul 2015
Latest activity Answered by Sebastian Castro on 10 Jul 2015

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

  0 Comments

Log in to comment.

Products

No products are associated with this question.

1 Answer

Answer by Sebastian Castro on 10 Jul 2015
 Accepted Answer

The most general answer to your question is to use the Model Explorer. It's a great tool that lets you navigate through a model hierarchy and look at all the variables defined in different places.

You can also

  1. Search for variables within the Model Explorer.
  2. Right-click a variable in Model Explorer and select "Find where used".
  3. Right-click any Simulink model or block and select "Find referenced variables".
  4. Use the Simulink.findVars function to do search variables programmatically. [Example here]

- Sebastian

  0 Comments

Log in to comment.


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!