I am calling Octave script from PHP and passing parameters to it. But I get the unexpected output.
The PHP code I'm using to pass arguments and call the Octave script is:
$a=8;
$b=3;
$cmd = "C:\Octave\Octave4\bin\octave-cli C:\wamp\www\dspace\add.m $a $b";
$ex = passthru($cmd, $op);
var_dump($ex);
My Octave script:
arglist = argv();
a = arglist{1};
b = arglist{2};
function f (a,b)
a + b
endfunction
printf(f(a,b));
The output get is:
ans = 107
Expected output is:
11
How can I fix this?