主要内容

AttachData

Attach data from project to test plan

Description

DataObjMod = AttachData(TPObj,DataObj) attaches data, DataObj, from a project to the test plan, TPObj.

DoeObjMod = AttachData(TPObj,DataObj,'Name1','Value1',…) attaches data from a project to a test plan with values specified by name-value arguments.

When you attach data to a test plan, the Name property of the test plan inputs determines the data channels. If Name is empty, then Name is set to Symbol. If Name does not exist in the dataset, an error results.

When a test plan has attached data, you can change only the symbols, ranges, or nonlinear transforms of the test plan inputs.

example

Examples

collapse all

Use all the data in DATA in the test plan TESTPLAN and set the input ranges to the data range.

newD = AttachData(TESTPLAN, DATA,'usedatarange',true);

Match data in DATA to the best design in the test plan TESTPLAN within specified tolerances.

Datatol = [0.075, 100, 1, 2];
unmatch = 'all';
moredata = 'all';
moredes = 'none';
AttachData(testplan, data ,...
    'tolerances',    tol,...
    'unmatcheddata', unmatch,...
    'moredata',      moredata,...
    'moredesign',    moredes);

Use data from one project in another project.

p1 = mbcmodel.LoadProject( filename );
p2 = mbcmodel.LoadProject( filename2 );
p1.Testplan.AttachData( p2.Data );

Input Arguments

collapse all

Test plan, specified as a project object.

Data objects, specified as a n-by-1 array, where n is the number of data objects in the test plan.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'usedatarange',true

Use the optional name-value arguments to specify how the software attaches the data to a design.

Unmatched data to attach to design, specified as all or none.

Example: 'unmatcheddata',all

Additional data to attach to design, specified as all or closest.

Example: 'unmatcheddata',all

Additional designs to attach to design objects, specified as all or closest.

Example: 'moredesign',none

Data tolerances, specified as a 1-by-NumInputs array, where NumInputs of is the number of data inputs.

Data Types: double

Data range for test plan input ranges, specified as false or true.

Example: 'usedatarange',true

Data Types: logical

Output Arguments

collapse all

Data objects in test plan, returned as a n-by-1 array, where n is the number of data objects.

Version History

Introduced before R2006a