メインコンテンツ

mbcmodel.testplan

Properties and methods for test plan objects

Description

Use these properties and object functions to create and examine test plan objects.

Creation

Create a mbcmodel.testplan object using CreateTestplan.

Properties

expand all

n-by-1 cell array of mbcdoe.design objects per model level, where n is the number of model levels. There can be one best design for each level, but the software uses the best global (2) level design to match to data when you call AttachData.

To set the design globalDesign as the best design at the global (2) level:

>> T.BestDesign{2} = globalDesign

Data Types: double

This property is read-only.

BoundaryTree = mbcmodel.testplan.Boundary returns the boundary tree for the test plan. The BoundaryTree is a container for all the boundary models you create. BoundaryTree is an mbcboundary.Tree object.

To get the boundary tree from the test plan Boundary property:

BoundaryTree = mbcmodel.testplan.Boundary

Data Types: char | string

This property is read-only.

Data objects to be returned to mbcmodel.testplan, specified as an array.

For the test plan object T, this code returns a 1-by-1 array if the test plan has a data object attached. Otherwise, the code returns a 0-by-1 array.

allD = T.Data;

Data Types: char | string

n-by-1 cell array of default model objects for each model level, where n is the number of model levels.

To get the default model objects for use in creating a response, use this code:

>> models = T.DefaultModels
>> LocalModel = CreateModel(models{1}, 'Local Polynomial Spline');
>> GlobalModel = CreateModel(models{2}, 'RBF');
>> R = CreateResponse(T, 'TQ', LocalModel, GlobalModel, 'Maximum')

Data Types: char | string

n-by-1 cell array that contains the number design objects per model level, where n is the number of model levels.

When using designs at the command-line, the software treats designs as an array. In the Design Editor, you can build a design tree, where child designs inherit characteristics from the parent design. At the command-line, you can copy and modify designs. By default, designs are added to the top-level of the design tree. To build tree structures at the command-line, use the Parent argument of the AddDesign method. The tree structure cannot be used at the command-line any further, but you can use the design tree in the Design Editor after you load the project into the Model Browser.

To get local designs only:

LocalDesigns = T.Designs{1}

To get global designs only:

GlobalDesigns = T.Designs{2}

To get the fifth global design:

D = T.Design {2}(5)
After modifying the design, you must call UpdateDesign, or reassign to the test plan as follows:
T.Design {2}(5) = D

Data Types: double

n-by-1 cell array of mbcdoe.modelinput objects per model level, where n is the number of model levels.

This property is read-only.

n-by-1 array of character vectors that contains the data signal names that the software is modeling, where n is the number of modeled signals.

Example: ["afr" "egr" "load" "n" "spark" "logno" "tq"]

Data Types: string

This property is read-only.

n-by-1 array that contains the number of inputs per model level, where n is the number of model levels.

For the test plan object T, this code indicates that the test plan has 2 local and 4 global inputs.

>> L = T.InputsPerLevel
L =
	 2  4

Data Types: double

This property is read-only.

Number of levels in the hierarchical model.

For more information about levels, see Understanding Model Structure for Scripting.

Example: levels = T.Levels;

Data Types: double

Test plan object name, specified as a mbcmodel.testplan object.

Example: 'holliday_data.mat'

Data Types: char | string

This property is read-only.

Project object name, specified as a character vector.

Data Types: char | string

This property is read-only.

n-by-1 array that contains the number of test plan responses per model level, where n is the number of model levels.

For more information about the relationship between test plans and responses, see Understanding Model Structure for Scripting.

Array of test plan, T, responses:

>>R = T.Responses

Data Types: char | string

This property is read-only.

Summary of mbcmodel.response object statistics, specified as a structure with fields Statistics and Names. Statistics include validation RMSE.

For more information, see SummaryStatistics.

Data Types: char | string

Array of mbcmodel.response object names. Use only before attaching data to the test plan.

The response names should match the channel names in the response data set.

Data Types: string

Array of mbcmodel.data object test plan validation data.

Data Types: char | string

Object Functions

AddDesignAdd design to test plan
AttachDataAttach data from project to test plan
BoundaryModelGet boundary model from test plan
CreateDesignCreate design object for test plan or model
CreateResponseCreate response model for test plan
DetachDataDetach data from test plan
FindDesignFind test plan design by name
InputSetupDialogOpen Input Setup dialog box to edit inputs
RemoveDesignRemove design from test plan
UpdateDesignUpdate design in test plan

Examples

collapse all

To create a test plan using a test plan template, enter:

T = CreateTestplan(P1, 'd:\MBCwork\TQtemplate1', 'newtestplan')
testplan = CreateTestplan(P, 'example_testplan')

To create a test plan using inputs per level, enter:

T = P.CreateTestplan([1,2])

To specify the input information in a cell array of mbcmodel.modelinput objects, enter:

% Define Inputs for test plan
LocalInputs = mbcmodel.modelinput('Symbol','S',...
    'Name','SPARK',...
    'Range',[0 50]);
GlobalInputs = mbcmodel.modelinput('Symbol',{'N','L','ICP',...
'ECP'},'Name',{'SPEED','LOAD','INT_ADV','EXH_RET'},...
    'Range',{[500 6000],[0.0679    0.9502],[-5 50],[-5 50]});
% create test plan
testplan = CreateTestplan( project, {LocalInputs,...
GlobalInputs} );

Or

T = P.CreateTestplan({LocalInputs,GlobalInputs})

To specify the input information in a cell array, enter:

localInputs = {'S',0,50,'','SPARK'};           
globalInputs = {'N',   800, 5000, '', 'ENGSPEED'
           'L',   0.1,    1, '', 'LOAD'
           'EXH',  -5,   50, '', 'EXHCAM'
           'INT',  -5,   50, '', 'INTCAM'};

T = CreateTestplan(P,{localInputs,globalInputs}); 

Version History

Introduced before R2006a