1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| % Start simulation
clc;
close all;
clear all;
simulation_input; % j'ai mis les inputs de ma simulation dans ce fichier
% =========================================================================
for loop = 1:length(test_cases)
tic
model_folder = cd;
simulation_input;
case_loop = sprintf('%d',test_cases(loop));
fprintf('================================================================\n')
fprintf('Simulation of case %s...................',case_loop)
% loading needed parameters
% =========================================================================
parameter_file = sprintf('D:/SimulinkModels/param_%s.m',case_loop);
exec_file = sprintf('run %s',parameter_file);
eval(exec_file);
%open_system(model_name);
% starting simulation
% =========================================================================
set_param(model_name,'simulationmode',sim_mode)
sim(model_name,[0 t_final]);
fprintf('finished\n')
% move result-files to data directory
% =====================================================================
% save results...
fprintf('Plotting...................')
figure;
plot(time, output_1)
saveas(gcf,['output_1_case_',case_loop,'.fig'])
print (h,'-dpdf',['output_1_case_loop])
fprintf('finished\n')
t_sim_case = toc; % CPU time end
t_sim_case = num2str(t_sim_case);
fprintf('Simulation Real Time of case %s: %s\n', case_loop, t_sim_case)
fprintf('================================================================\n')
close all;
clear all;
end
fprintf('All Simulations finished!!\n') |
Partager