Main Content

copy

Create deep copy of uniform state sampler object

Since R2023b

    Description

    sampler2 = copy(sampler1) creates a deep copy of the uniform state sampler object.

    example

    Examples

    collapse all

    Create a uniform state sampler using the default input state space.

    sampler{1} = stateSamplerUniform;

    Create a copy of the first instance of the uniform state sampler.

    sampler{2} = copy(sampler{1});

    Verify that both samplers are the same by checking if they have the same property values.

    isequal(sampler{1}.StateSpace,sampler{2}.StateSpace)
    ans = logical
       1
    
    

    Input Arguments

    collapse all

    State sampler object, specified as a stateSamplerUniform object.

    Output Arguments

    collapse all

    Copy of the state sampler object, returned as a stateSamplerUniform object.

    Version History

    Introduced in R2023b