Main Content


Set Test Manager preferences



settings = sltest.testmanager.setpref(group,preference,value) sets Test Manager preferences in group, specified by preference, and value.


settings = sltest.testmanager.setpref('MATLABReleases','ReleaseList',releasePrefs) updates the specified releases in your preferences with the ones specified by releasePrefs. This preference lets you use releases other than the current release for testing.

This syntax replaces the existing list of added releases. Including a release path that is already in the release preferences returns an error. To include that release in the releasePrefs, first delete the existing release list.


settings = sltest.testmanager.setpref('MATLABReleases',release,releasePref) adds the specified release to the list of releases in Test Manager preferences. Set releasePref to {[]} to delete that release.


simlog_setting = sltest.testmanager.setpref('ShowSimulationLogs','IncludeOnCommandPrompt',value) shows the simulation logs at the MATLAB® command prompt when value is true. The default value is false.


name_setting = sltest.testmanager.setpref('ResultSetProperty','ResultSetName',name) sets the name to use for test result sets. The specified name applies to all result sets for tests that you run after you set the preference. This function does not change the names of existing result sets.


collapse all

Change the display setting of two Test Manager preferences in test suite sections.

Get test suite display preferences.

settings = sltest.testmanager.getpref('TestSuiteDisplay')
settings = 

  struct with fields:

        TestTag: 1
    Description: 1
    Requirement: 1
       Callback: 1
       Coverage: 1

Hide the Description and Requirement sections.

settings = sltest.testmanager.setpref...
settings = 

  struct with fields:

           TestTag: 1
       Description: 0
       Requirement: 0
          Callback: 1
          Coverage: 1
    TestFileOption: 1

You can add several releases at a time, delete the added releases, or add and delete a single release in your Test Manager MATLAB Release preferences.

Set your preferences to include several releases. Create a structure for each release.

r1 = struct('Name','18b',...
r2 = struct('Name','19a',...
r3 = struct('Name','20a',...

Add the releases using sltest.testmanager.setpref.


Add another release to the preferences.

r4 = struct('Name','19b',...

Delete a release from the preferences.


Turn on displaying the simulation logs at the command prompt.


Revert to not displaying simulation logs output at the command prompt.


View the current simulation logs display setting.


Set a nondefault name to use for new result sets.

   'ResultSetName','My Result Set');

Revert to the default result set name by specifying an empty character vector.


Input Arguments

collapse all

Preference group name, specified as one of these values:

  • 'TestFileDisplay' — File section display preferences

  • 'TestSuiteDisplay' — Test suite section display preferences

  • 'TestCaseDisplay' — Test case section display preferences

  • 'MATLABReleases' — MATLAB releases for testing preference

  • 'ShowSimulationLogs' — Whether to show simulation logs at the command prompt

  • 'ResultSetProperty' — Name to use for the result set

Preference name, specified as a character vector. Use settings = sltest.testmanager.getpref(group) to get valid preferences for a particular group.

Example: ('TestSuiteDisplay','TagText')

Example: ('ShowSimulationLogs','IncludeOnCommandPrompt')

Example: ('ResultSetProperty','ResultSetName')

Preference value, specified as a numeric or logical 1 (true) to display the preference or 0 (false) to hide it.

Example: true

Example: {true,false}

Release to add to or delete from preferences, specified as a character vector.

Example: '20a'

Release information, specified as a structure or cell array of structures. In the structure, include, in this order:

  • 'Name',releaseName

  • 'MATLABRoot',Path

  • 'Selected',logical

Example: struct('Name','20a','MATLABRoot','\\mypath','Selected',true)

Release information, specified as a structure or as {[]}. Use {[]} to delete the release information from the preferences. In the structure, include:

  • 'Name',releaseName

  • 'MATLABRoot',Path

  • 'Selected',Boolean

Example: struct('Name','20a','MATLABRoot','\\mypath','Selected',true)

Name of the result set, specified as a character vector or string. The new name applies only to new test runs. Setting this property does not change the existing result set names. If you set a new name and then import a result set, the imported result set retains its original name.

Example: 'my Result Set'

Output Arguments

collapse all

Preference settings, returned as a structure.

Preference setting for whether to display simulation logs at the command line, returned as 0 (false) or 1 (true).

Preference setting for result set name, returned as a character vector.

Version History

Introduced in R2017a

expand all