How to obtain a file using the command System

1 view (last 30 days)
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?

Accepted Answer

Walter Roberson
Walter Roberson on 19 Jun 2015
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';
  2 Comments
Igor Noberto
Igor Noberto on 19 Jun 2015
Thanks Walter.
And if I want to wait for a specific amount of time, say 5 min. Am I able to use the sleep option?
I'm trying to incorporate the sleep in my command line, but I can't.

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!