Main Content

removeParameter

Class: sdo.ParameterSpace
Package: sdo

Remove parameter from sdo.ParameterSpace object

Syntax

ps = removeParameter(ps0,p)

Description

ps = removeParameter(ps0,p) removes the parameter, p, from the sdo.ParameterSpace object, ps0, and returns the updated object, ps.

Input Arguments

ps0

Parameter space, specified as an sdo.ParameterSpace object.

p

Parameters to be removed, specified as one of the following:

  • Vector of param.Continuous objects — Parameter objects. For example, p = sdo.getParameterFromModel('sdoHydraulicCylinder','Ac').

  • Parameter name, specified as a character vector or string. For example, 'Ac'.

Output Arguments

ps

Updated parameter space, returned as an sdo.ParameterSpace object.

Examples

expand all

Create an sdo.ParameterSpace object, ps, for the Ac and K parameters of the sdoHydraulicCylinder model.

load_system('sdoHydraulicCylinder');
p  = sdo.getParameterFromModel('sdoHydraulicCylinder',{'Ac','K'});
ps = sdo.ParameterSpace(p)
ps = 
  ParameterSpace with properties:

            ParameterNames: {'Ac'  'K'}
    ParameterDistributions: [1x2 prob.UniformDistribution]
           RankCorrelation: []
                   Options: [1x1 sdo.SampleOptions]
                     Notes: []

Remove K from ps.

ps = removeParameter(ps,p(2))
ps = 
  ParameterSpace with properties:

            ParameterNames: {'Ac'}
    ParameterDistributions: [1x1 prob.UniformDistribution]
           RankCorrelation: []
                   Options: [1x1 sdo.SampleOptions]
                     Notes: []

Remove Ac from ps using the parameter name.

ps = removeParameter(ps,'Ac');