giving values to array as a 3 variable combination
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!