I successfully made some script to be executed by matlab throught CLI from a web interface of my own. But now, I am trying to get the output of the scripts that we can launch from it.
Does anyone know how to get the values returned by matlab ?
For instance, my script "A.m" is :
a = [3, 6, 9];
I want to get :
a =
3 6 9
My script "B.m" is :
a = [1 2 3 4 6 4 3 4 5]
b = a + 2
plot(b)
grid on
I want to get the result below + the image generated :
a =
1 2 3 4 6 4 3 4 5
b =
3 4 5 6 8 6 5 6 7
I have used these previous topics :
- Matlab: Running an m-file from command-line
- Make PHP wait for Matlab script to finish executing
- How can I stop MATLAB from returning until after a command-line script completes?
- get output from shell_exec command as command runs
Thanks a lot !
Edit : I call my files this way :
C:\...\matlab\bin> matlab -wait -minimize -nodesktop
-automation -r "run('C:\...\Source2.m');exit;"