I want to color the bars in a MATLAB barplot as suggested below in the out-commented part of my code, however, when this part is included, it is throwing an error. How could I solve this?
x = [1.5,2.5;1.5,2.5;1.5,2.5];
b = bar(x)
% b.FaceColor = 'flat';
% b.CData(1,:).FaceColor = [0.4,0.6,0.8];
% b.CData(2,:).FaceColor = [0.3,0.4,0.6];
set(gca,'XTickLabel',{'\fontsize{16}Cond1', '\fontsize{16}Cond2', '\fontsize{16}Cond3'})
legend('\fontsize{16}Class1','\fontsize{16}Class2');
ylim([0 5.5])
ylabel('\fontsize{16}Intensities [V]')
title('\fontsize{16}Intensities for all conditions');