diff --git a/matlab/run_many_cycling.m b/matlab/run_many_cycling.m index a347c51e578b351b2cf450af12a94b8e72582bd9..df4a5c1b2fa4edb63c602ba24241295d44d105a1 100644 --- a/matlab/run_many_cycling.m +++ b/matlab/run_many_cycling.m @@ -1,4 +1,7 @@ -%"monteCarlo" example +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Script for example of energy-accuracy trade-off evaluatio with the +% cycling trace +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Load data disp('Loads data') @@ -12,29 +15,26 @@ settings=get_settings_cycling(); color=[[0.7,0.0,0.0];[0.0,0.7,0.0];[0.7,0.0,0.7];[0.0,0.0,0.7];[0.0,0.7,0.7];[0.7,0.7,0.0]]; %vector of refrences for P P_treshold=[4.0,5.0,6.0,8.0,10.0,12.0]; -%nubmer of runs per each P -n_run=1; +%nubmer of simulations per each P +n_run=3; %allocate memory for output energy=zeros(n_run,length(P_treshold)); error=zeros(n_run,length(P_treshold)); -for j=1:length(P_treshold) - %set P reference - settings.P_treshold=P_treshold(j); - %run simulations - for k=1:n_run - %% Run the GNSS-aided INS - disp('Running the GNSS-aided INS') - P_treshold(j) - k - out_data=GPSaidedINS_cycling(in_data,settings); - energy(k,j)=out_data.energy; - error(k,j)=out_data.error; +%% Iterate over the threshold for tr(P) +for j=1:length(P_treshold) + disp(['Starting simulations with threshold for P equal to:', num2str(P_treshold(j))]) %display reached treshold + settings.P_treshold=P_treshold(j); %set P reference + for k=1:n_run %iterate over the number of simulations per threshold + disp(['Simulation number:',num2str(k)]) %display simulation number + out_data=GPSaidedINS_cycling(in_data,settings); % Run the GNSS-aided INS + energy(k,j)=out_data.energy; % store energy + error(k,j)=out_data.error; % store positioning error end end -%plot data +%% Plot data figure hold on xlabel('energy')