Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: How to run .exe file from matlab
Posted:
Jan 3, 2013 9:38 AM
|
|
"Hema " <hema.wadhwa@intecsea.com> wrote in message news:kc3hia$gja$1@newscl01ah.mathworks.com... > 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}); end
Call this as:
anyexecutable dat1234.dat dat2345.dat dat3456.dat
Now the data from the third file whose name you specified is stored in mydata{3}
-- Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
|
|
|