Matlab running external applications

Matlab running external applications

When create a program with Matlab, in some condition we need Matlab running external applications. You can implement this method in Linux or Windows Operating System.  The method Matlab running external applications is simple. Example, we want to call gedit/notepad application. So, we can use type this text in command line Matlab or from Matlab editor :

!gedit

The next problem is how if we want to call other program from Matlab with some of parameter. We can call other program from Matlab with some of parameter with use sprintf and system function in Matlab. Example, we want to open a text file with name “test.txt” from gedit with Matlab. Copy this below text and copy in your Matlab editor :

ext_app = 'gedit';
new_file = 'test.txt';

strcommand = sprintf('%s %s', ext_app, new_file);
system(strcommand);

So, with this method you can use Matlab running external applications or call other program from Matlab with some of parameter.

 

Add a Comment

Your email address will not be published. Required fields are marked *