Clear Filters
Clear Filters

How do I to plot bar graph normalized to compare two controller

10 views (last 30 days)
Hello everybody,
I am trying to achieve the same graph on the image below. I want to compare the results of two controllers for a wind turbine. As in the picture, the output data should be normalized against the "base" controller (blue bar). The values displayed are the root-mean square (RMS) of the error. The .mat file contains the data: "Result_base" and "Result_fuzzy".
Thanks for any help
load('data.mat')
error=[12.1,5.0e+3];
for idx=1:2
% norm_jonkman(:,idx)=(Result_jonkman(:,idx)-min(Result_jonkman(:,idx)))/(max(Result_jonkman(:,idx))-min(Result_jonkman(:,idx)));
% norm_fuzzy(:,idx)=(Result_fuzzy(:,idx)-min(Result_fuzzy(:,idx)))/(max(Result_fuzzy(:,idx)-min(Result_fuzzy(:,idx))));
RMS_base(idx)=rms( Result_base(:,idx)-error(idx));
RMS_Fuzzy(idx)=rms(Result_fuzzy(:,idx)-error(idx));
y(idx,:)= [1-( (RMS_base(idx)- RMS_base(idx))/RMS_base(idx)) 1-((RMS_Fuzzy(idx)- RMS_base(idx))/RMS_base(idx));];
end
figure;
bar(y)

Answers (0)

Categories

Find more on View and Analyze Simulation Results in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!