removeParameter
Remove parameter from sdo.ParameterSpace
or
sdo.GriddedSpace
object
Description
Examples
Remove Parameter From sdo.ParameterSpace
Object
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: [1x2 prob.UniformDistribution] RankCorrelation: [] Notes: [] ParameterNames: {'Ac' 'K'} Options: [1x1 sdo.SampleOptions]
Remove K
from ps
.
ps = removeParameter(ps,p(2))
ps = ParameterSpace with properties: ParameterDistributions: [1x1 prob.UniformDistribution] RankCorrelation: [] Notes: [] ParameterNames: {'Ac'} Options: [1x1 sdo.SampleOptions]
Remove Ac
from ps
using the parameter name.
ps = removeParameter(ps,'Ac');
Remove Parameters from Gridded Parameter Space
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: {{1x2 cell} {1x2 cell}} Notes: [] Spaces: {1x0 cell} ParameterNames: {'FeedCon0' 'FeedTemp0'} Options: [1x1 sdo.GriddingOptions]
removeParameter
updates ParameterValues
and ParameterNames
to reflect the reduced set of parameters in the space.
Input Arguments
ps0
— Parameter space
sdo.ParameterSpace
object | sdo.GriddedSpace
object
Parameter space to remove parameters from, specified as an
sdo.ParameterSpace
or sdo.GriddedSpace
object.
p
— Parameters to remove
character vector | cell array of character vectors | string | parameter object | vector of parameter objects
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.Continuous
object,param.Discrete
object, or vector of parameter objects. Usually, you obtain these objects usingsdo.getParameterFromModel
orsdo.getStateFromModel
.
Output Arguments
ps
— Updated parameter space
sdo.ParameterSpace
object | sdo.GriddedSpace
object
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)