I have converted my .m file into a standalone application with the aid of deploytool.
Now, I want to run my application and get the outputs using PHP. I can run my application on cmd. And it will return the outputs and print. But I can not get the outputs from PHP.
this is the main file of my standalone application:
function [onsets,pitch,endpoint] = matxtwavtomidi( input_args )
input=strsplit(input_args);
[s wavFs] = audioread(input{1});
[onsets,pitch,endpoint]=txtwavtomidi(s);
end
this is the result I get from cmd:
C:\Users\user> START /WAIT D:/java/matlab/matxtwavtomidi.exe D:/song.wav
onsets =
1.7183
1.7183
2.3220
2.3220
pitch =
60
72
62
74
endpoint =
1.8576
1.9040
3.0650
2.4149
this is my PHP:
<?php
$stringcmd= "START /WAIT D:/java/matlab/matxtwavtomidi.exe ";
$stringwav = "D:/song.wav";
exec($stringcmd.$stringwav, $output, $return_var);
echo $stringcmd.$stringwav;
var_dump($output);
var_dump($return_var);
?>
this is the result from php:
START /WAIT D:/java/matlab/matxtwavtomidi.exe D:/song.wav
array(0) { }
int(0)
Everytime when i run the application on cmd, it will always show the application's icon picture in the middle of the screen for 2 seconds and then disappear.
And when I run my PHP, it did show the icon picture,so I think it did run the application. And there are no error in php_error_log and apache error_log.
My problem is,why can't my PHP get the outputs of the application from cmd? And how to solve this problem?
(Sorry for my poor English..)