0

I am writing a PHP script to fetch some values from XML. Now, I want to pass those values to Matlab. Is it possible to run matlab code in PHP script? If yes, do I need to have matlab installed in /var/www/html (I'm using Ubuntu)?

1 Answer 1

1

This is how such a command would look in Windows:

<?php

$command='matlab -nodesktop -r "run emailToSpeech.m";';
exec ( $command );

?>

In this example, the .m script has to reside in the same directory as your PHP script, but MATLAB itself does not. (And you could always change directories if you prefer to do it that way.) I would expect Ubuntu to work similarly, although I haven't had a chance to try it yet.

The question linked below has a fuller discussion in case you want to explore further:

running MATLAB code from php

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.