How to run exe file with inputs
Ältere Kommentare anzeigen
I have earthquake data with the extension suds and I downloaded the sud2asc.exe file to convert the suds file to ascii file. The sud2asc.exe file is executed from the command window and requires the simple command for the conversion:
> sud2asc 20100901.suds 20100901.txt
The program does not read the wild card * or ?, so I have to convert all the event files individually. Since there are thousands of files, doing it individually will take an enormous time. Is there any way I can read the sud2asc.exe file in matlab and let it execute for all the events by itself?
Thanks
Antworten (2)
Aurelien Queffurust
am 23 Sep. 2011
1 Stimme
To answer at the title of your question : How do I pass arguments into and out of my standalone executable?
If you have the source code of sud2asc , make changes accordingly. Otherwise you will have to call the standalone within a for-loop.
Jan
am 23 Sep. 2011
Yes.
cd('YourDataFolder'); % Set accordingly
List = dir('*.suds');
for iFile = 1:numel(List)
sudsName = List(iFile).name;
[dum, FileName] = fileparts(sudsName);
txtName = [FileName, '.txt'];
system(['sud2asc ', sudsName, ' ', txtName]);
end
Kategorien
Mehr zu Historical Contests finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!