Hey.
Im running a file called serialWind3D.exe.
My plan is to use alot of input-parameters, which all will affect the output-file. I can run the .exe-file, but cannot make a code which will use 20 inputs, and then give me 20 output-files.
Can somebody help me?

댓글 수: 2

John D'Errico
John D'Errico 2017년 3월 11일
Where did the compiled code come from? Google does not seem to find anything by that name.
Torbjørn Slinde
Torbjørn Slinde 2017년 3월 13일
I will try to be more spesific. Here is my code, which will give me the Output-file.
tic
[status,cmdout] = system('serialWind3D.exe -c configstation_j.dat -f stations -r 0.05 -s inp_coor_j.dat','-echo')
toc
if (status~=0)
disp('Wind3D returned an error')
end
I do want to create a while loop where I can: 1. Create alot of input-files where I change the variables in the text-file. 2. Inp_coor.dat is the output-file, and it will give me a inp_coor_out.dat, but i want it to be inp_coor_out1.dat, inp_coor_out2.dat osv. I want the number of output-files to be the same as the input-files.
I hope that this gave more sense.

댓글을 달려면 로그인하십시오.

답변 (1개)

Guillaume
Guillaume 2017년 3월 13일

0 개 추천

I'm unclear on exactly what it is you're asking. Is it as simple as:
%create your input files any way you want. Name them inp_coor_1.dat, inp_coor_2.dat, etc.
numfiles = 15; %however many there are
for filenumber = 1:numfiles
status = system(sprintf('serialWind3D.exe -c configstation_j.dat -f stations -r 0.05 inp_coor_%d.dat', ...
filenumber), '-echo');
if status
fprintf('Wind3D returned an error for file number %s\n', filenumber);
end
end
According to your description the above would create inp_coor_1_out.dat, inp_coor_2_out.dat, etc.

카테고리

도움말 센터 및 File Exchange에서 Google에 대해 자세히 알아보기

태그

질문:

2017년 3월 11일

답변:

2017년 3월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by