MATLAB: How to programmatically select a group from the Signal Builder block in Simulink 6.1 (R14SP1)

blockbuildersignalsimulink

I have created a model with a Signal Builder block that has several groups. I would like to write a function that runs the simulation with different groups activated.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The ability to programmatically select a group in a Signal Builder block is not available in Simulink 6.1 (R14SP1).
The most effective way to change groups is to simply select the corresponding tab in the dialog box. To repeatedly run the simulation with each group consecutively, you can press the 'play all' button on the toolbar.
Another option is to use the From Workspace block. This may be especially effective if you already have the data you are using to create the Signal Builder block. Instead of creating a Signal Builder block, use the data directly in the simulation with the From Workspace block. By changing the value of the variable in the workspace, you can change the signal that is being output.
If neither of the above methods are satisfactory, you can use the following command to programmatically select a tab assuming the Signal Builder dialog box is open:
sigbuilder('FigMenu',get_param(MySignalBuilder,'UserData'),[],'showTab',n)
where 'MySignalBuilder' is a handle to the Signal Builder block, and 'n' is the group you want to activate. Please note that if the dialog box is not open, this function will produce an error.