Matlab System Block Initialization

1 次查看(过去 30 天)
Felix H.
Felix H. 2016-3-10
I want to create a Matlab System Block from a System Object in a Simulink Model. The System Object expects an instance of a class in its constructor and assigns this instance to a property. According to the documentation this feature is not portable to the Matlab System Block because the constructor needs to be callable without any input arguments.
I would like to know how I can realize this behavior in Simulink. Where in the model do I need to create the class instance (Model Callbacks?) and how can I assign this instance to the Matlab System Block property before the simulation is started.
Here is a minimal Matlab example of what I want to recreate in Simulink:
inst_a = class_a();
inst_b = class_b();
sys_a = sysobj(inst_a);
sys_b = sysobj(inst_b);
% different behavior of stepImpl depending on the class instance given to the constructor
sys_a.step(some_input);
sys_b.step(some_input);

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by