About Matlab C++ Math Library
10 views (last 30 days)
Show older comments
Hello,
I want to develop a standalone C++ application which uses Matlab C++ Math library. Simply, I want to implement a nonlinear dynamical system and needs Matlab C++ functions to integrate it for simulation.
I've found the following link which mentions about "MATLAB C++ Math Library" and it says include the following header
#include matlab.hpp
I use Matlab R2011a and couldn't find this header file under $MatlabHome$/extern/include folder. Is "matlab.hpp" obsolete? How can I find the header file which includes information about "mwArray" class?
Regards.
0 Comments
Answers (2)
Kaustubha Govind
on 24 Apr 2012
AFAIK, the MATLAB C++ Math Library was retired around R14. You now need to use the MATLAB Compiler product to deploy MATLAB code onto a machine that does not have MATLAB installed. See R14 Release Notes:
"MATLAB Compiler 4 uses the new MATLAB Compiler Runtime (MCR), which is a standalone set of shared libraries that enable the execution of compiled MATLAB files, instead of the MATLAB C/C++ Math and Graphics Libraries. The MCR provides complete support for all features of the MATLAB language."
If you only want to run MATLAB code from a C++ application running on a machine where MATLAB is installed, consider using the MATLAB Engine nterface.
0 Comments
Oktay Arslan
on 24 Apr 2012
1 Comment
Kaustubha Govind
on 25 Apr 2012
Oktay: Do you need this task to be fast in terms of development time or performance? For performance, I don't think there is a more efficient way of calling the ODE functions outside of MATLAB other than calling into MATLAB Engine or using MATLAB Compiler (since the ODE solvers are not supported for code generation). If you mean fast in terms of development time, I'm not sure that using the (erstwhile) MATLAB C++ Math Library is much different from using the MATLAB Engine interface.
About the compiler errors regarding the libraries - perhaps you are attempting to build a 32-bit binary from your C++ application? Visual Studio for example is configured to produce 32-bit binaries by default, so it can't link against the 64-bit MATLAB libraries. You need to configure your project for an x64 target.
See Also
Categories
Find more on Deploy to C++ Applications Using mwArray API (C++03) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!