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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)