The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to run .exe file from matlab
Replies: 8   Last Post: Jan 11, 2013 10:03 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: How to run .exe file from matlab
Posted: Jan 3, 2013 9:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Hema " <> wrote in message
> Hi walter,
> I am runing an executable from matlab, but I have more than one file as
> input file. What will be the solution in that case?
> fname1 = dat1234.dat';
> fname2 = dat1234.dat';
> fname 3= dat1234.dat';
> system(['C:\......\anyexecutable.exe <', fname1,fname2,fname3]);
> I shall apreciate any help with this.

The easiest way is to have your function accept an arbitrary number of
string inputs and LOAD or use your custom file format reader function to
read in the data from the files whose names you pass into the executable.

function anyexecutable(varargin)
mydata = cell(1, nargin);
for whichdata = 1:nargin
mydata{whichdata} = load(varargin{whichdata});

Call this as:

anyexecutable dat1234.dat dat2345.dat dat3456.dat

Now the data from the third file whose name you specified is stored in

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.