Can I use MATLAB Coder 2.1 (R2011b) to generate C code from MATLAB code that has cell arrays?
3 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2011-12-8
编辑: MathWorks Support Team
2015-2-10
My MATLAB code that has cell arrays returns an error when I try to generate code using MATLAB Coder 2.1 (R2011b). Does MATLAB Coder support code generation from cell arrays?
采纳的回答
MathWorks Support Team
2013-10-18
MATLAB Coder 2.1 (R2011b) does not support code generation from cell arrays. Hence, there is no way to utilize them within the MATLAB code.
However, MATLAB Coder does support structures, so a rough workaround could be implemented if you were willing to convert all of your cell arrays into structures. Some functions that can help with this process are CELL2STRUCT and STRUCT2CELL.
Please note that these functions must be used outside of the MATLAB code, such as from the command window or through a script or function that is not intended to be used with MATLAB Coder for code generation.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!