Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 带设定点步长的Sim命令_Matlab - Fatal编程技术网

Matlab 带设定点步长的Sim命令

Matlab 带设定点步长的Sim命令,matlab,Matlab,我使用sim命令在Matlab中绘制操纵变量和设备输出: sim(MPC, 500/T_p, [h_0, T_0]); MPC当然是模拟模型,[h_0,T_0]是工厂输出的设定点。它工作正常,但设定点在时间上是恒定的。是否有任何方法可以配置sim命令,使设定点在时间上发生变化(例如,n个间隔后的步长+50%)@Adrian是正确的,sim确实可以将[n x 2]维度的矩阵作为输入。因此,答案大致是: % step properties step_time = 50; h_step_coeff

我使用
sim
命令在Matlab中绘制操纵变量和设备输出:

sim(MPC, 500/T_p, [h_0, T_0]);

MPC
当然是模拟模型,
[h_0,T_0]
是工厂输出的设定点。它工作正常,但设定点在时间上是恒定的。是否有任何方法可以配置
sim
命令,使设定点在时间上发生变化(例如,n个间隔后的步长+50%)

@Adrian是正确的,
sim
确实可以将
[n x 2]
维度的矩阵作为输入。因此,答案大致是:

% step properties
step_time = 50;
h_step_coeff = 1.5;
T_step_coeff = 1;

% construct setpoints matrix, run simulation
offset = round(step_time/T_p);
setpoints = repmat([h_0, T_0], offset, 1);
setpoints_step =  repmat([h_0*h_step_coeff, T_0*T_step_coeff], round(500/T_p) - offset, 1);
setpoints = cat(1, setpoints, setpoints_step);
sim(MPC, 500/T_p, setpoints);

我不确定
sim
是否可以将
[nx2]
矩阵作为输入,否则您可以循环使用它。