How can I utlized an external program through MATLAB
Show older comments
Hello - I'd like to run some data analysis through MATLAB, but one part requires the use of another program. Is there a way to automatically run the program through the use of MATLAB, meaning I do all the work from MATLAB and just code what I'd like the other program to do? Thank you
12 Comments
OCDER
on 2 Jul 2018
Depends on if the external program can be run without a user interface and takes inputs and generates outputs. Does the external program takes inputs and outputs, something like this?
ExternalProgram.exe -input myimage.png -output myprocessedimage.png
Victoria
on 2 Jul 2018
OCDER
on 2 Jul 2018
You could use the system command to call the exe file as you would in the command prompt of windows. But if the program cannot accept inputs/outputs, then all your matlab program could do is open the exe file, and then the user would have to intervene and use the external program. Not sure how you'll get an automated way to run an external program from then.
Victoria
on 2 Jul 2018
OCDER
on 2 Jul 2018
Is it an exe file?
system('c:\path_to_program\externprogram.exe')
or
winopen('c:\path_to_program\externprogram.exe')
Victoria
on 2 Jul 2018
OCDER
on 2 Jul 2018
That's what I was asking you about. Different exe files may have different input/output capabilities. You have to look for the document on using this external program - see if there's a way to pass inputs to the program directly when opening the software. I don't know what this external program is, so I can't help you at this point.
Hopefully you can do this:
system('externprogram.exe -input myimage.png -output mimage.png')
Then you can automate everything.
Victoria
on 2 Jul 2018
Victoria
on 2 Jul 2018
Walter Roberson
on 2 Jul 2018
You could try
!externprogram.exe /help
or
!externprogram.exe -help
/help and -help and --help and /? are the commonly used methods of asking for a description of the program arguments
It is possible that you might end up needing to use Java Robot class to automate use of the program.
Victoria
on 6 Jul 2018
Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!