Matlab code to C++ classes in 2018 VS 2019

조회 수: 3 (최근 30일)
Bogdan Iliuta
Bogdan Iliuta 2019년 10월 11일
답변: Denis Gurchenkov 2019년 10월 11일
Hello,
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

채택된 답변

Denis Gurchenkov
Denis Gurchenkov 2019년 10월 11일
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.

추가 답변 (0개)

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by