文档

setBlockParameter

设置块参数用于特定的模拟通过SimulationInput对象,

语法

= in.setBlockParameter (BlockPath ParameterName、价值……ParameterNameN,家)

描述

例子

在= in.setBlockParameter (BlockPath,ParameterName,价值,...ParameterNameN,在指定的块上设置参数BlockPath与属性ParameterName价值.您可以在一个模型中使用相同的块参数设置多个块参数SimulationInput对象。有关块参数的更多信息,请参见屏蔽一些参数

例子

全部折叠

方法修改模型的块参数SimulationInput对象。

打开模型

mdl =“sldemo_househeat”;open_system (mdl);

创建一个SimulationInput对象。

在= Si万博1manbetxmulink.SimulationInput (mdl);

修改参数。

在= in.setBlockParameter (“sldemo_househeat /设置点”,“价值”,“300”);

模拟模型。

= sim(中)

输入参数

全部折叠

BlockPath是更改参数的块的路径

例子:“sldemo_househeat /设置点”

指定可选的逗号分隔的对ParameterName、价值参数。ParameterName参数名称和价值为对应值。ParameterName必须出现在单引号内(' ').块参数值通常指定为字符向量。可以以任意顺序指定多个名称和值对参数Name1, Value1,…,的家ParameterNameN,对遵循相同的语法set_param

例子:“价值”,“350”

介绍了R2017a

这个话题有用吗?