Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: Running C++ and Matlab file together
Posted:
Mar 8, 2013 8:14 AM
|
|
"Amarjot " <amarjotsingh20@gmail.com> wrote in message news:khc3bi$oa1$1@newscl01ah.mathworks.com... > Hi, > I have a code in two components. One components is in C++ while the > second one is in Matlab. I run my code in c++ and then save the output in > a folder and then run the matlab code on the putput. Is there a way to run > the c++ code in matlab after which its output can be directly passed to > matlab code?
There are several ways; which one is "best" depends on the specific details of your MATLAB and C++ codes.
* Create a MEX-file from your C++ file and call the MEX-file from within MATLAB, or * Create an Engine application and call MATLAB from your C++ code, or * Use the SYSTEM function inside MATLAB to invoke the application compiled from your C++ code, or * Use MATLAB Coder to generate C++ code from your MATLAB code and stay completely in C++, or * Rewrite your C++ code in MATLAB or your MATLAB code in C++ manually
There are probably a few others I haven't thought of.
http://www.mathworks.com/help/matlab/external-interfaces.html
http://www.mathworks.com/help/matlab/ref/system.html
http://www.mathworks.com/products/matlab-coder/
-- Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
|
|
|