Modelling in simulink to obtain a function taking one parameter after code generation

void DoProcessing(ReceiveEvent enEvent)
{
switch(enEvent)
{
case a:
abcd();
break;
case b:
efgh();
break;
}
}
How can a model be developed in simulink (without using thhe Matlab function block)which on code generation generates a function of the above nature?
Thanks!

回答 (2 件)

Joseph Stalin
Joseph Stalin 2013 年 2 月 26 日

0 投票

To pass an argument of a function please configure the sybsystem block to reusable function having the argument passed via Input port.
Code generation is more flexible that you can create this function in a user specified function name and file name as well.

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

質問済み:

2013 年 2 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by