Matlab System Block Initialization

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 件)

カテゴリ

ヘルプ センター および File ExchangeCreate System Objects についてさらに検索

質問済み:

2016 年 3 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by