addExcelSpecification
Add a Microsoft Excel sheet to baseline criteria or test case inputs
Syntax
Description
Examples
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
Object to which to add Excel sheet or cell data, specified as a baseline criteria or test case input object.
Excel sheet to add to baseline criteria or test case inputs, specified as a character vector.
Example: 'Optics'
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.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)