MATLAB: How to obtain a file using the command System

outputsystem

I need to run a code made for read a image, and return other 3 images based on the first. The code was compiled to run with MCR 2012a, which I already have.
I can use the code in the shell, and works fine, the 3 new files are created in the current folder as the original. But as I need to perform this task for more than 2000 images, matlab would help me.
The thing is that I'm not getting anything when trying to use matlab. Files are not created.
That's what I'm trying to do:
command = 'set PATH=%PATH%; C:\"Program Files"\MATLAB\"MATLAB Compiler Runtime"\v717\runtime\win64 & start C:\Users\in48\LEAR_2013 C:\Users\in48\cara7.png';
[status,cmdout] = system(command);
Do I need to inform something else to matlab?

Best Answer

When you use MS Windows "start" and do not specify the /wait option, the specified program will be started in a command window but then the next command will be continued on to without waiting for the command to finish. The return status you get will only tell you whether the start was successful. The command you run will produce the files when it is ready to do so.
You might wish to use
command = 'set PATH=%PATH%; C:\"Program Files"\MATLAB\"MATLAB Compiler Runtime"\v717\runtime\win64 & start /wait C:\Users\in48\LEAR_2013 C:\Users\in48\cara7.png';