Call C++ code from MATLAB?

前端 未结 4 593
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 03:36

I have some code which I need to code in C++ due to heavy reliance on templates. I want to call this code from MATLAB: basically, I need to pass some parameters to the C++ c

4条回答
  •  有刺的猬
    2020-12-03 04:23

    The C++ files are actually compiled by an external compiler. Use mex -setup to select which one (here is a list of supported compilers). Therefore, you shouldn't have too many weird things happen, nor should you be too restricted by what you can do.

    I did some MEX stuff last year, and my memory is a bit rusty, but you do need to construct MATLAB arrays using MEX functions. I found the MATLAB documentation adequate, and the whole experience not too painful.

提交回复
热议问题