问题
I need to write a script that will run external program from matlab and to get output results from it. This program should simulate 20 variants. I made those 20 files in matlab, and I'm able to open external program, but I am not able to write a command that will simulate the files in it. And return me output results. (Input files have .idf extension and output .eso)
I tried with these and similar commands
for id=1:20;
system(sprintf('C:\...\myprogram.exe<''variant_%i.idf',id));
i=1+1;
end
or
for id=1:20;
cmd_line = '"C:\...\myprogram.exe" -f variant_%i.idf -o variant_%i.eso';
[status, result] = system(cmd_line);
i=1+1;
end
I need to do this for exam, and I had only 3 weeks of matlab and never studied programming, so I'm sorry if this is a stupid question, but I don't know where else to ask.
回答1:
You may change your "myprogram.exe" in order to report the output data into a file.
来源:https://stackoverflow.com/questions/24046758/running-external-program-in-matlab-and-getting-output-results