removeParameter
Remove parameter from sdo.ParameterSpace or
sdo.GriddedSpace object
Description
Examples
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:
ParameterDistributions: [1×2 prob.UniformDistribution]
RankCorrelation: []
Notes: []
ParameterNames: {'Ac' 'K'}
Options: [1×1 sdo.SampleOptions]
Remove K from ps.
ps = removeParameter(ps,p(2))
ps =
ParameterSpace with properties:
ParameterDistributions: [1×1 prob.UniformDistribution]
RankCorrelation: []
Notes: []
ParameterNames: {'Ac'}
Options: [1×1 sdo.SampleOptions]
Remove Ac from ps using the parameter name.
ps = removeParameter(ps,'Ac');Open the sdoCSTR model and extract continuous parameters A, h, FeedCon0, and FeedTemp0. Assign values to these parameters for gridded sampling and define the parameter space.
mdl = "sdoCSTR"; open_system(mdl); p = sdo.getParameterFromModel(mdl,{'A','h','FeedCon0','FeedTemp0'}); Avals = {0.2 0.6 1.0 1.4 1.8 2.2}; hvals = {0.5 1.5 2.5 3.5}; Convals = {9.5 10.0 10.5}; Tempvals = {250,275,300}; ps0 = sdo.GriddedSpace(p,{Avals,hvals,Convals,Tempvals});
Suppose that you decide not to sample A and h as part of this parameter space. Remove these parameters by providing their names to removeParameters.
ps = removeParameter(ps0,{'A','h'})ps =
GriddedSpace with properties:
ParameterValues: {{1×3 cell} {1×3 cell}}
Notes: []
Spaces: {1×0 cell}
ParameterNames: {'FeedCon0' 'FeedTemp0'}
Options: [1×1 sdo.GriddingOptions]
removeParameter updates ParameterValues and ParameterNames to reflect the reduced set of parameters in the space.
Input Arguments
Parameter space to remove parameters from, specified as an
sdo.ParameterSpace or sdo.GriddedSpace
object.
Parameters to remove from ps0, specified as one of the
following:
Character vector, cell array of character vectors, or string containing the names of the parameters to remove from
ps0. For example,'A1',{'A1','A2'}, or"A1".param.Continuousobject,param.Discreteobject, or vector of parameter objects. Usually, you obtain these objects usingsdo.getParameterFromModelorsdo.getStateFromModel.
Output Arguments
Updated parameter space, returned as an sdo.ParameterSpace or
sdo.GriddedSpace object. removeParameter removes
the parameter or parameters specified in p, setting
ps.ParameterNames to reflect the removal. The function also sets
ps.ParameterDistributions (for randomly sampled parameter spaces)
or ps.ParameterValues (for gridded parameter spaces) to reflect the
removed parameters.
Version History
Introduced in R2014a
See Also
addParameter | sdo.ParameterSpace | sdo.GriddedSpace | sdo.getParameterFromModel | setValues
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)