Main Content

export

Class: sltest.testmanager.ParameterSet
Package: sltest.testmanager

Export parameter set to Excel spreadsheet

Syntax

export(ps,filename)
export(ps,filename,sheet)

Description

export(ps,filename) exports sltest.testmanager.ParameterSet object data to an Excel file. The data for each parameter is exported into the spreadsheet columns, Parameter, Value, and BlockPath. For example, this spreadsheet shows three parameters from different model workspaces: the top model (which is unnamed), the MdlRefLeaf1 model workspace, and the MdlRefLeaf2 model workspace.

Excel spreadsheet columns titled parameter, value, and block path.

Note

By default, the parameter set data is exported to the first sheet in the specified file and existing data in that sheet is overwritten.

export(ps,filename,sheet) exports the parameter set data to the specified sheet in the Excel file.

Input Arguments

expand all

Parameter set to export, specified as an sltest.testmanager.ParameterSet object.

File name of the Excel® workbook, specified as a string or character vector. If the file does not exist, it is created.

Name of Excel workbook sheet, specified as a string or character vector. If you do not specify a sheet name, the parameter set data is exported to the first sheet in the specified file and existing data in that sheet is overwritten. If you specify a sheet name that does not exist, that sheet is created.

Examples

expand all

Export test parameters to an Excel spreadsheet.

Add a parameter set a to a test case (tc), then override the value of parameter a in that parameter set. Export the parameter set to a sheet in an Excel file.

ps = addParameterSet(tc,'Name','Param Set');
addParameterOverride(ps,'a',1);
export(ps,'myPSfile.xlsx','Sheet2');

Version History

Introduced in R2020b