To help the OP with running system commands from a PHP webpage, my post here is relevant (copied below).
We do exactly this all the time. I call them voodoo pages. Here's some working code:
<?php
    $command="uptime"; $output; $retval; $errors="";
    exec ($command, &$output, &$retval);
    echo $output[0] . "\n";
    unset($output);
?>
And the output to the webpage served:
13:40:19 up 22 days, 23:14,  0 users,  load average: 0.04, 0.02, 0.00
And the additional note I added in the comments below:
Relative vs absolute paths may be a pain... $command might need to be /usr/bin/uptime or another could be /usr/bin/ls /home/chris/ftp. Normally, scripts' working directory is where they live in the file system. MATLAB is a windows program, yes? My experience is you will need absolute paths for the program and any files passed as arguments, example: $command="c:\\matlab\\matlab.exe c:\\www\\somefile.wav" And then single quotes required for silly NTFS names, TAB command line completion works well for examples. Or use proper 8.3 name with the ~ in it.