我想建立一个类的对象,该对象包含simulink模型的所有变量作为其属性。
为了以后能够使用并行仿真,我想在方法中有一个函数,该函数接受所有属性并将它们提供给Simulink SimulationInput对象(通过'setVariable'方法),但是setVariable-function在运行时不会填充对象“ in”的变量。]>
代码看起来像这样:
classdef SimSetup properties mdl = 'SimulinkFile' SimulationTime = 2 Plant in end methods function this = SimSetup() open_system(this.mdl); this.Plant = load('PlantData.mat','xPlant'); end function createSimIn(this) this.in = Simulink.SimulationInput(this.mdl); this.in = this.in.setVariable('SimulationTime', this.SimulationTime); end end
提前感谢
我想建立一个类的对象,该对象包含simulink模型的所有变量作为其属性。为了以后能够使用并行仿真,我想在方法中使用一个函数,...
错误是以下原因: