主要内容

randomizeRunOrder

R2026b

Randomize run order of design of experiments (DOE) object

Since R2026b

    Description

    dobj = randomizeRunOrder(dobj) returns the design of experiments (DOE) object dobj with a randomized run order. The function does the following:

    • Sets the IsRandomized property to true

    • Puts the rows in the Design property in randomized order

    • Stores the original run order in the StandardRunOrder property.

    If the input object dobj contains blocks, the function updates the BlockIndices property and randomizes only the run order within each block.

    example

    Examples

    collapse all

    Create a full factorial design object with three factors.

    dff = fullFactorialDOE(3);

    dff is a fullFactorialDOE object with eight runs. Display the runs in the design.

    dff.Design
    ans = 8×3 table
        Factor1    Factor2    Factor3
        _______    _______    _______
    
          -1         -1         -1   
          -1         -1          1   
          -1          1         -1   
          -1          1          1   
           1         -1         -1   
           1         -1          1   
           1          1         -1   
           1          1          1   
    
    

    Randomize the order of the design runs, and display the new design table.

    dff = randomizeRunOrder(dff);
    dff.Design
    ans = 8×3 table
        Factor1    Factor2    Factor3
        _______    _______    _______
    
           1         -1          1   
          -1          1         -1   
           1          1         -1   
           1          1          1   
           1         -1         -1   
          -1         -1         -1   
          -1         -1          1   
          -1          1          1   
    
    

    Display the original design run order.

    idx = dff.StandardRunOrder
    idx = 8×1
    
         6
         7
         2
         8
         5
         1
         3
         4
    
    

    Display the design rows in their original order.

    dff.Design(idx',:)
    ans = 8×3 table
        Factor1    Factor2    Factor3
        _______    _______    _______
    
          -1         -1         -1   
          -1         -1          1   
          -1          1         -1   
          -1          1          1   
           1         -1         -1   
           1         -1          1   
           1          1         -1   
           1          1          1   
    
    

    Input Arguments

    collapse all

    Experiment design, specified as one of the following DOE objects: fullFactorialDOE, fractionalFactorialDOE, mixtureDOE, optimalDOE, responseSurfaceDOE, or taguchiDOE.

    Output Arguments

    collapse all

    Randomized design, returned as a DOE object of the same type as the input object dobj. The randomizeRunOrder function stores the nonrandomized run order in the StandardRunOrder object property, and sets the IsRandomized object property value to 1 (true). You can display the design of dobj in nonrandomized run order using dobj.Design(dobj.StandardRunOrder',:).

    If dobj is a responseSurfaceDOE object with a blocked design, the randomizeRunOrder function randomizes only the run order within each block.

    Version History

    Introduced in R2026b