Php calls matlab

Source: Internet
Author: User
Php calls matlab too big. you want to export an executable file, exe, jar, or dll, and then use the program to call it.

The exported exe is called in php.

Install matlab and the vc6 compiler. C ++ has never been used. after VC6.0 is installed, the system has the vc6 compiler.

Matlab command line window:

>> mex -setupPlease choose your compiler for building external interface (MEX) files:  Would you 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  Are 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 has changed to support MATLAB            variables with more than 2^32-1 elements.  In the near future            you will be required to update your code to utilize the new            API. You can find more information about this at:            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 you like 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  Are 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

Select VC6

M File: funBt_fun.m

Just a little bit

function c= funBt_fun(input)c=input+1;

Matlab command window:

Cd XXX enters the M file path

Mcc-m funBt_fun.m for compilation

Generate funbt_fun.exe

PHP call:

$ CommandBt = "E:/funBt_fun.exe Fringillidae ";
System ($ commandBt );

Note: Do not use the built-in Matlab Compiler. use VC6.

You can use the built-in file or export the exe. The strange thing is that the file can be executed in DOS and cannot be called in PHP. No error, no response, debugging cannot be adjusted, and it is hard to handle ..

Dll C ++ brother please refer to http://developer.51cto.com/art/200909/150944.htm

If the jar package is used, it should be okay if java is used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.