MATLAB Help Center
Return list of variables in the model workspace of a model
varList = whos(mdlWks)
varList = whos(mdlWks) returns a list of the variables in the model workspace represented by the Simulink.ModelWorkspace object mdlWks.
varList
mdlWks
Simulink.ModelWorkspace
example
collapse all
Open the example model vdp.
vdp
openExample('simulink_general/VanDerPolOscillatorExample')
Create a Simulink.ModelWorkspace object that represents the model workspace of vdp.
mdlWks = get_param('vdp','ModelWorkspace');
Create some variables in the model workspace.
assignin(mdlWks,'myVar',5.12) assignin(mdlWks,'myOtherVar',7.22)
Display a list of the variables in the model workspace.
whos(mdlWks)
Name Size Bytes Class Attributes myOtherVar 1x1 8 double myVar 1x1 8 double
Target model workspace, specified as a Simulink.ModelWorkspace object.
List of variables, returned as a nested structure array. For details about the information in the list, see whos.
whos
Introduced before R2006a
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office