addExcelSpecification
Add a Microsoft Excel sheet to baseline criteria or test case inputs
Syntax
Description
Examples
Add a Sheet to Baseline Criteria
Create the test file, test suite, and test case structure.
tf = sltest.testmanager.TestFile('Add Excel Test'); ts = createTestSuite(tf,'Add Excel Suite'); tc = createTestCase(ts,'baseline','Baseline Excel Test Case');
Add baseline criteria from an Excel file. Specifying two sheets creates two baseline criteria.
base = addBaselineCriteria(tc,'C:\MATLAB\baseline.xlsx','Sheets',{'Optics','Converter'});
Add the sheet X2Out
to the first set.
base(1).addExcelSpecification('Sheet','X2Out');
Show the contents of the Sheet
property of the
Excel specifications for each
baseline criteria. The first set now includes the X2Out
sheet.
base(1).ExcelSpecifications(:).Sheet base(2).ExcelSpecifications(:).Sheet
ans = 'Optics' ans = 'X2Out' ans = 'Converter'
Input Arguments
obj
— Object to which to add Excel sheet or cell data
baseline criteria object | test case object
Object to which to add Excel sheet or cell data, specified as a baseline criteria or test case input object.
sheet
— Excel sheet to add
character vector | string
Excel sheet to add to baseline criteria or test case inputs, specified as a character vector.
Example: 'Optics'
range
— Range of cells to add
character vector | string
Range of cells from the specified sheet to add to test case inputs, specified as a character vector or string in one of these forms:
Ways to specify Range
| Description |
---|---|
Rectangular Range | Specify the range using the syntax
Example:
|
Unspecified or Empty | If unspecified, the importing function automatically detects the used range. Example:
Note: Used Range refers to the rectangular portion of the spreadsheet that actually contains data. The importing function automatically detects the used range by trimming leading and trailing rows and columns that do not contain data. Text that is only white space is considered data and is captured within the used range. |
Row Range | You can identify the range by specifying the
beginning and ending rows using Excel row designators. Then
Example:
|
Column Range | You can identify the range by specifying the
beginning and ending columns using Excel column designators. Then
Example:
|
Excel Named Range | In Excel, you can create names to identify ranges
in the spreadsheet. For instance, you can select a
rectangular portion of the spreadsheet and call it
Example:
|
Example: 'A1:C20'
Version History
Introduced in R2017b
MATLAB Command
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
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)