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

1 view (last 30 days)
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

Answers (2)

Titus Edelhofer
Titus Edelhofer on 4 Nov 2014
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 on 4 Nov 2014
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 Comment
Titus Edelhofer
Titus Edelhofer on 4 Nov 2014
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

Sign in to comment.

Categories

Find more on Simulink Coder 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!