필터 지우기
필터 지우기

giving values to array as a 3 variable combination

조회 수: 1 (최근 30일)
Antonios Georgantas
Antonios Georgantas 2016년 7월 11일
편집: dpb 2016년 7월 11일
Good morning everyone. I have this code.
for thr = 0.2:0.2:2.4, %for threshold
for pol = 0.1:0.1:1.0, %for politeness factor
fileID=fopen('parameters.txt','w');
fprintf (fileID,'%4.2f %4.2f\r\n', thr, pol);
fclose(fileID);
[status,cmdout]=dos('"C:\Program Files\TSS-Transport Simulation Systems\Aimsun 8.0.3 (R26859)\aconsole.exe" -script python_script_2.py dutch.ang');
for indFile =1:12,
report = dlmread(['Mobil_MOVEMENT_' num2str(indFile-1) '.txt']);
times = report(:, 6);
tt(i,j,indFile) = max(times) - min(times);
end
save('travelTime', 'tt');
j = j + 1;
end
i = i + 1;
j = 1;
I have a source code in C++ and it takes through this matlab script two values from the "parameters.txt".
I run the console through [status,cmdout] and for each combination of these parameters (pol,thr), I get some meausurements in the Mobil_MOVEMENT_.txt. However, what I have done is , to create many different of this txt. For example, Mobil_MOVEMENT_0, Mobil_MOVEMENT_1, Mobil_MOVEMENT_2 until Mobil_MOVEMENT_11.
What I want is for each of these .txt to get the minimum and maximum values and save them in a table tt: tt(i,j,indFile) = max(times) - min(times);
What doesn't work is that after the simulations finish, they create exactly the same results for all the combinations, which in my case are 130. I believe, they aren't taken probably by the table.
Could you help me, how to get them correctly?
Thank you

답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by