Matlab System Block Initialization

1 view (last 30 days)
Felix H.
Felix H. on 10 Mar 2016
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);

Answers (0)

Categories

Find more on Event Functions in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!