I want to pass MATLAB output to my php code.
My MATLAB code, I have:
function x = returnX()
x = 100;
end
And my PHP code:
<?php
$command = "matlab -nojvm -nodesktop -nodisplay -r \"x = returnX();\"";
passthru($command, $output);
echo($output)
?>
However, this prints 0, not 100.
When I type the command in my cmd, it shows 100. But when I try it through PHP code, it does not work. Can anyone help me how to set the output value of MATLAB to php variable? Thanks!