diff --git a/matlab/plot_tradeoff.m b/matlab/plot_tradeoff.m new file mode 100644 index 0000000000000000000000000000000000000000..95645e0bafe817b3a70b801db9fdbc65b4675982 --- /dev/null +++ b/matlab/plot_tradeoff.m @@ -0,0 +1,14 @@ +%% Plot data for tradeoff evaluation +%vector of RGB colors for plotting for the different P references +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]]; +%actual plot +figure +hold on +xlabel('energy') +ylabel('error') +title('cycling energy accuracy tracking trade-off') +grid + +for j=1:length(P_treshold) + scatter(energy(:,j), error(:,j),20,color(j,:),'o','filled') +end \ No newline at end of file diff --git a/matlab/run_many_cycling.m b/matlab/run_many_cycling.m index 6739bd4c910fb5afdc3d8076344526cd8aa0a07b..d29e06041623c6f49e9c9a929681704819f8c843 100644 --- a/matlab/run_many_cycling.m +++ b/matlab/run_many_cycling.m @@ -4,19 +4,18 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Load data -disp('Loads data') +disp('Load data') load('cycling_input_data'); %% Load filter settings -disp('Loads settings') +disp('Load settings') settings=get_settings_cycling(); -%vector of RGB colors for plotting for the different P references -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]]; +%% Settings for tradeoff evaluation %vector of refrences for P -P_treshold=[4.0,5.0,6.0,8.0,10.0,12.0]; +P_treshold=[4.0,5.0];%,6.0,8.0,10.0,12.0]; %nubmer of simulations per each P -n_run=30; +n_run=1; %allocate memory for output energy=zeros(n_run,length(P_treshold)); error=zeros(n_run,length(P_treshold)); @@ -33,15 +32,6 @@ for j=1:length(P_treshold) end end - -%% Plot data -figure -hold on -xlabel('energy') -ylabel('error') -title('cycling energy accuracy tracking trade-off') -grid - -for j=1:length(P_treshold) - scatter(energy(:,j), error(:,j),20,color(j,:),'o','filled') -end \ No newline at end of file +%% Plot results +disp('Plot results') +plot_tradeoff \ No newline at end of file