Calling executables from MATLAB

5 views (last 30 days)
Ram
Ram on 22 Jan 2011
I am an under grad life sciences student and a self-taught MATLAB user. I am working on a tool to classify genotoxins(using neural networks) and for this purpose I will be using molecular descriptors (quantitatively expressed physicochemical properties of chemical compounds).
To calculate descriptors for my training set I used a tool called Mold2, which has a command line interface. Now I am done with training and have my network. I need to create a GUI for my tool which is supposed to get inputs from the user and call mold2 to create an output file, the output file should again be taken back into MATLAB to simulate my network.
I need to know if this whole idea is possible and if possible, how should I go about it??

Accepted Answer

Paulo Silva
Paulo Silva on 22 Jan 2011
You can send commands to your OS command line, here's one example that runs in MS Windows 7, don't know about other OS but might be similar
eval('!calc.exe') %this will open windows calculator
The eval calls matlab expressions, if you put one ! before your command will be executed in the OS command line.
  6 Comments
Ram
Ram on 22 Jan 2011
Thanks for your comments jiro and silva. But am sorry I should have mentioned this before, mold2 needs no installation it just requires the command prompt path to be set to the folder that contains mold2 and the input file. It then works on the input file and generates an output file in the same folder. I have intensions of releasing it both as an mfile and a standalone.
When I just tried !mold2.exe it didn’t work. But it worked after I copied mold2 and the input file into the current directory.
So when I release my program as an mfile I can ask the user to save my file in the same directory as mold2 and set it as his current directory. Half work done!! But for my standalone version.. What options do I have??
Jiro Doke
Jiro Doke on 25 Jan 2011
You can either build in an interface to ask the user to select the path to your mold2 program, and call it with the full absolute path, or you can include mold2 program as additional files when you create your standalone version. Take a look at the documentation for MATLAB Compiler on how to add additional files to your application.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox 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!