Main Content

whos

Return list of variables in the model workspace of a model

Description

example

varList = whos(mdlWks) returns a list of the variables in the model workspace represented by the Simulink.ModelWorkspace object mdlWks.

Examples

collapse all

Open the example model vdp.

open_system('vdp')

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  

Input Arguments

collapse all

Target model workspace, specified as a Simulink.ModelWorkspace object.

Output Arguments

collapse all

List of variables, returned as a nested structure array. For details about the information in the list, see whos.

Introduced before R2006a