How can I utlized an external program through MATLAB

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

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
I'm unsure. I tried pulling it up by using !externalprogram.exe, but I don't get anything. There's no error. It seems to run fine, but the program doesn't open up. Does this mean that it cannot run through MATLAB?
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.
What would be the best way to check if I can even open the program on MATLAB?
Is it an exe file?
system('c:\path_to_program\externprogram.exe')
or
winopen('c:\path_to_program\externprogram.exe')
It is. I was finally apply to open the program through MATLAB, thank you! Is there any way to check if I can code something in MATLAB so that I don't actually do anything in the program and everything will be done automatically?
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.
Unfortunately, it doesn't work. Regardless, thank you for your help.
I didn't expect that work as you need to look up how that external program was built... Where did you get the external software from? Maybe ask the programmer if there's documents for how to pass on inputs/outputs
I just did. Hopefully it'll work once I get an email back
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.
I talked to the programmer - it isn't compatible with MATLAB as of yet. Thank you for the help.

Sign in to comment.

Answers (0)

Asked:

on 2 Jul 2018

Commented:

on 6 Jul 2018

Community Treasure Hunt

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

Start Hunting!