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

1 visualización (últimos 30 días)
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

Respuestas (2)

Titus Edelhofer
Titus Edelhofer el 4 de Nov. de 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 el 4 de Nov. de 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 comentario
Titus Edelhofer
Titus Edelhofer el 4 de Nov. de 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

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by