主要内容

Generate

Generate design points

Description

DoeObjMod = Generate(DoeObj) regenerates the design with the current design properties and number of points. Calling Generate for Latin Hypercube Sampling can result in a different design.

example

DoeObjMod = Generate(DoeObj,NumPoints) generates the number of points specified by NumPoints using the current generator settings. You cannot specify the number of points for all design types (e.g., Central Composite, Box Behnken). Therefore, NumPoints is not supported for all design types.

The design Type must have a writable property 'NumberOfPoints' to use this syntax.

Using Generate with constrained space-filling is not guaranteed to produce a design with the specified number of points. Use ConstrainedGenerate instead.

example

DoeObjMod = Generate(DoeObj,'Name1','Value1',…) augments the design with the generator specified by the name-value pairs.

example

Examples

collapse all

DoeObjMod = Generate(DoeObj,10);

Generate a 15-point Latin Hypercube Sampling design.

globalDesign = TP.CreateDesign(2, 'Type',...
 'Latin Hypercube Sampling');
globalDesign = Generate(globalDesign, 15)

Use this code to regenerate the design and get a different 15-point Latin Hypercube Sampling design.

globalDesign = Generate(globalDesign);

Use this code to create and generate a Halton design with 50 points.

haltonDesign = CreateDesign( inputs, 'Type',...
 'Halton Sequence', 'Name', 'Halton' );
haltonDesign = Generate( haltonDesign, 'NumberOfPoints', 50 );

Use this code to create and generate a Halton design with specified scrambling and other properties.

haltonDesignWithScrambling = haltonDesign.CreateDesign...
( 'Name', 'Scrambled Halton' );
haltonDesignWithScrambling = Generate...
(haltonDesignWithScrambling,
 'Scramble', 'RR2', 'PrimeLeap', true );

Use this code to create a full factorial design and specify the number of levels when generating the design.

design = CreateDesign( inputs, 'Type', 'Full Factorial' );
design = Generate( design, 'NumberOfLevels', [50 50] );

You can use name-value pair arguments to specify design generator properties.

C = OptDesign.CreateCandidateSet(OptDesign,...
       'Type', 'Grid',...
       'NumberOfLevels',[21 21 21]);

OptDesign = Generate(OptDesign,...
    'Type','V-optimal',...
    'CandidateSet',C,...
    'MaxIterations',200,...
    'NoImprovement', 50,...
    'NumberOfPoints',200);

The preceding code is equivalent to the following code that sets the properties individually and assigns the updated object to the design.

P = OptDesign.Generator;
P.Type = 'V-optimal';
P.CandidateSet.NumberOfLevels(:)=21;
P.MaxIterations = 200;
P.NumberOfPoints = 200;
P.NoImprovement = 50;
OptDesign.Generator = P;

You see an error if you call Generate when the design Style is User-defined or Experimental data.

Input Arguments

collapse all

Instance of mbcdoe.design class, specified as a mbcdoe.design doe design object.

Number of design points, specified as a mbcdoe.designconstraint object.

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: 'Type','V-optimal'

The design generator properties determines the applicable name-value pairs.

Generator type, specified as the comma-separated pair consisting of 'Type' and character vector.

Example: 'Type','V-optimal'

Number of points, specified as the comma-separated pair consisting of 'NumberOfPoints' and an integer.

Example: 'NumberOfPoints',20

Output Arguments

collapse all

Modified instance of mbcdoe.design class, returned as a mbcdoe.design object.

Version History

Introduced in R2008a