如何将输入变量从php传递给matlab函数

时间:2017-02-16 19:47:27

标签: php matlab

如何将输入变量从php传递到matlab函数? 这是我的代码 在html部分

    <form action="" method="post" style="margin-top:60px">
        Enter a Brangay ID <input type="text" name="input1"><br />
        Enter a Month Number <input type="text" name="input2"><br />
        <input type="submit" name="submit" value="send"  /><br />
    </form>

在php部分

if(isset($_POST['submit'])) {
// form submitted, now we can look at the data that came through
// the value inside the brackets comes from the name attribute of the input field. (just like submit above)
$in1 = $_POST['input1'];
  $in2 = $_POST['input2'];
$inputDir  = "C:\Program Files\MATLAB\R2013a\bin";
$command = "matlab -sd ".$inputDir." -r saladsalad('".$in1."','".$in2."')";
exec($command);

0 个答案:

没有答案