日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php调用matlab

發布時間:2025/3/14 php 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php调用matlab 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

matlab太大了,想導出一個可執行的文件,exe或jar或dll吧,然后用程序調用。

我導出的exe,用php調用

安裝matlab,安裝vc6編譯器。沒用過C++,下了個VC6.0安裝了,系統就有vc6編譯器了。

Matlab命令行窗口:

>> mex -setup Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? ySelect 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: 2Please verify your choices: Compiler: Microsoft Visual C++ 6.0 Location: C:\Program Files\Microsoft Visual Studio Are these correct [y]/n? yTrying 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 -setup Please choose your compiler for building standalone MATLAB applications: Would you like mbuild to locate installed compilers [y]/n? ySelect 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: 2Please verify your choices: Compiler: Microsoft Visual C++ 6.0 Location: C:\Program Files\Microsoft Visual Studio Are these correct [y]/n? yTrying 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

都選VC6

M文件:funBt_fun.m

隨便一點了就

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

Matlab命令窗口:

cd XXX進入M文件所在路徑

mcc -m funBt_fun.m ? ? ? ? ?進行編譯

生成funBt_fun.exe

PHP調用:

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

注:不要用Matlab自帶的編譯器啊,用VC6

哥用自帶的,也可以導出exe,奇怪的是在DOS下可執行,在PHP下就調用不了。沒錯誤,沒反應,調試都沒法調,苦死。。

dll C++的兄弟請參考http://developer.51cto.com/art/200909/150944.htm

jar包的話,會用java的應該都沒問題吧

轉載于:https://www.cnblogs.com/frostbelt/archive/2012/02/21/2361097.html

總結

以上是生活随笔為你收集整理的php调用matlab的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。