I am trying to execute a simple matlab function with input and output but it returns, even I only check the version of matlab
string '' (length=0)
array (size=0)
empty
int 1
my php code(check version)
$command = 'matlab -version';
$res = exec($command, $output, $return);
var_dump($res, $output, $return);
my php code(real work)
$command = "matlab -nojvm -nodesktop -nodisplay -r test (1,2,3)";
$res = exec($command, $output, $return);
var_dump($res, $output, $return);
Matlab code
function x = test(n1,n2,n3)
x = n1+n2+n3;
end

답변 (1개)

Walter Roberson
Walter Roberson 2015년 10월 11일

0 개 추천

$command = "matlab -nojvm -nodesktop -nodisplay -r 'test(1,2,3)'";

댓글 수: 1

Tsz Hei Yeung
Tsz Hei Yeung 2015년 10월 11일
It doesn't work too
Do I need to setup a matlab server, besides the wamp server?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2015년 10월 11일

댓글:

2015년 10월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by