Cell Arrays operation in level-2 matlab S-function for code generation

1 回表示 (過去 30 日間)
Nick105
Nick105 2014 年 11 月 4 日
コメント済み: Titus Edelhofer 2014 年 11 月 4 日
Hello
As we know that cell arrays operation for code generation is not supported in Matlab embedded function. But if the functions with cell arrays are writen in level-2 matlab S-function, it seems that it accepts cell arrays since it uses same syntax as m file does. So the functions are working fine at least under simulation enviroment.
My question is if the level-2 matlab S-function with cell arrays is supported for code generation, presumbly the tlc file has been done.
Thanks in advance.
Nick

回答 (2 件)

Titus Edelhofer
Titus Edelhofer 2014 年 11 月 4 日
Hi Nick,
yes, you can "inline" MATLAB S-functions with a .tlc file, see here. But depending on how your MATLAB code looks like (with the cell arrays) writing the .tlc file is probably not trivial.
Titus

Nick105
Nick105 2014 年 11 月 4 日
Titus
Thanks very much for your answer.
For your knowlege, apart from Matlab S-function. Are there any other methods in Matlab/Simulink to get cell arrays contained functions compiled for code generation? We would like to implement a algorithm which essentially requires cell processing.
Nick
  1 件のコメント
Titus Edelhofer
Titus Edelhofer 2014 年 11 月 4 日
Hi Nick,
no, not really. It depends on what you do with your cell arrays: if it's e.g. only for lists of strings, you might implement a class that uses for code generation C routines, where you use arrays of strings inside. Not trivial though. But if you do more than that with your cells, there are not many options, sorry.
Titus

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by