removeParameter
R2026bRemove parameter from sdo.ParameterSpace or
sdo.GriddedSpace object
Description
Examples
The CSTR subsystem block in the sdoCSTR model includes the parameters A and F.
Create an sdo.ParameterSpace object, ps, for the A and F parameters.
load_system("sdoCSTR"); p = sdo.getParameterFromModel("sdoCSTR",{'A','F'}); ps = sdo.ParameterSpace(p)
ps =
ParameterSpace with properties:
ParameterDistributions: [1×2 prob.UniformDistribution]
RankCorrelation: []
Notes: []
ParameterNames: {'A' 'F'}
Options: [1×1 sdo.SampleOptions]
Remove F from ps.
ps = removeParameter(ps,p(2))
ps =
ParameterSpace with properties:
ParameterDistributions: [1×1 prob.UniformDistribution]
RankCorrelation: []
Notes: []
ParameterNames: {'A'}
Options: [1×1 sdo.SampleOptions]
Remove A from ps using the parameter name.
ps = removeParameter(ps,"A")ps =
ParameterSpace with properties:
RankCorrelation: []
Notes: []
ParameterNames: {1×0 cell}
Options: [1×1 sdo.SampleOptions]
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)