Effacer les filtres
Effacer les filtres

Matlab code to C++ classes in 2018 VS 2019

1 vue (au cours des 30 derniers jours)
Bogdan Iliuta
Bogdan Iliuta le 11 Oct 2019
I'm interested in converting some matlab code to C++ classes but if I inspect the documentation of 2018 and 2019 versions it seems that CppInterfaceStyle is missing from coder.CodeConfig. Can you please confirm that this is only available in 2019 codegen version? If so, the 2018 codegen will not generate any C++ classes?
Another question is about genereting code for Matlab containers.Map or use of jsondecode(). It seems that using the default codegen configs it's not possible to generate C/C++ code if you want to use any of those. I can understand that this may be mathworks proprietary code and it can't be added in plain text to the generated C/C++ files, but is there a library (.so or .dll) and some header files to which I could link in order to be able to use Map and json parser ?
Thank you

Réponse acceptée

Denis Gurchenkov
Denis Gurchenkov le 11 Oct 2019
Hi Bogdan,
The CppInterfaceStyle config parameter has been added in R2019b. In prior releases, it is not possible to generate C++ classes using MATLAB Coder.
For containers.Map and jsondecode, one workaround is to use coder.ceval and coder.opaque to integrate C/C++ code (generated from MATLAB) with some third-party C or C++ library that does these tasks.

Plus de réponses (0)


En savoir plus sur Generating Code dans Help Center et File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by