Call Matlab from c/c++ , java etc
http://www.mathworks.com/help/matlab/matlab_external/calling-matlab-software-from-a-c-application.html
http://www.mathworks.com/help/matlab/matlab_external/compiling-engine-applications-with-the-mex-command.html#bsq78dr-9
Set env var First
export LD_LIBRARY_PATH=/mnt/kaustapps/MATLAB-faculty/R2011b.app/bin/glnxa64/:/mnt/kaustapps/MATLAB-faculty/R2011b.app/sys/os/glnxa64/:$LD_LIBRARY_PATH
UNIX Engine Example engdemo
To verify the build process on your computer, use the C example engdemo.c or the C++ example engdemo.cpp.- Copy one of the programs, for example, engdemo.c,
to your current working folder:
copyfile(fullfile(matlabroot,... 'extern','examples','eng_mat','engdemo.c'),... '.', 'f');
- Build the executable file:
mex('-v', '-f', fullfile(matlabroot,... 'bin','engopts.sh'),... 'engdemo.c');
- Verify that the build worked by looking in your current
working folder for the engdemo application:
dir engdemo
- Run the example in MATLAB:
!engdemo
Call C/C++ , java from Matlab
http://www.mathworks.com/help/matlab/ref/mex.html
http://www.mathworks.com/help/matlab/create-mex-files.html
Comments
Post a Comment