Reputation: 3757
I'm trying to convert a piece of MATLAB code into C++ via MATLAB coder. Many of the functions in the MATLAB code like imread
, imshow
, normcorr2
are not supported by MATLAB coder.
What are some options to deal with this? Would it be possible to rewrite these functions using C++ and insert them via MEX file? Note I have very little experience with MATLAB, so I may be talking out of my rear.
Upvotes: 3
Views: 638
Reputation: 36710
Your idea to provide C code to the coder is right, but mex does not work. Instead, you have to use coder.ceval
.
Another option is coder.extrinsic
, if you use it you tell the MATLAB coder not to generate code but rather call the function in MATLAB. If you do this, it obviously requires a MATLAB installation on the target system.
Upvotes: 1