MATLAB is too big, want to export an executable file, EXE or jar or DLL bar, and then use the program call.
I exported the exe, called with PHP
Install MATLAB and install the VC6 compiler. No use of C + +, under a VC6.0 installed, the system has VC6 compiler.
matlab Command Line window:
>> Mex-setupplease Choose your compiler for building external interface (MEX) Files:would your like Mex to locate Installed compilers [y]/n? Y Select a compiler: [1] lcc-win32 C 2.4.1 in C:\MATLAB\SYS\LCC [2] Microsoft Visual C + + 6.0 in C:\Program Files\Microsoft Visual Studio [0] None compiler:2 Please verify your choices:Compiler:Microsoft Visual C + + 6.0 Location:c:\program Files\Microsoft Visual Studio is these correct [y]/n? Y Trying to update options file:c:\documents and Settings\cnic\application Data\mathworks\matlab\r2009a\mexopts.bat From Template:c:\matlab\bin\win32\mexopts\msvc60opts.bat done ... ************************************** warning:the matlab C and Fortran API have changed to support MATLAB Vari Ables with more than 2^32-1 elements. In the the-the-future, you'll be required-to-update your code to utilize the new API. You can find more information on: Http://www.mathworks.com/support/solutions/data/1-5C27B9.html?solution=1-5C27B9 Building with the- Largearraydims option enables the new API. >> Mbuild-setupplease Choose your Compiler for building standalone MATLAB applications:would What do mbuild to locate installed compilers [y]/n? Y Select a compiler: [1] lcc-win32 C 2.4.1 in C:\MATLAB\SYS\LCC [2] Microsoft Visual C + + 6.0 in C:\Program Files\Microsoft Visual Studio [0] None compiler:2 Please verify your choices:Compiler:Microsoft Visual C + + 6.0 Location:c:\program Files\Microsoft Visual Studio is these correct [y]/n? Y Trying to update options file:c:\documents and Settings\cnic\application Data\mathworks\matlab\r2009a\compopts.bat From Template:c:\matlab\bin\win32\mbuildopts\msvc60compp.bat done ...
Mex-setup
Mbuild-setup
All Choose VC6
M File: funbt_fun.m
Just a little bit.
function c= funbt_fun (input) c=input+1;
MATLAB Command window:
cd XXX Enter the path of M file
Mcc-m FUNBT_FUN.M to compile
Generate Funbt_fun.exe
PHP Calls:
$commandBt = "E:/funbt_fun.exe Fringillidae"; system ($COMMANDBT);
Note: Do not use MATLAB comes with the compiler ah, with VC6
Elder brother with own, can also export EXE, Strange is in DOS executable, under PHP can not be called. No mistakes, no response, debugging can not be adjusted, bitter death.
Jar package, it's going to be all right with Java.