MATLAB: How I chance the bars colors

bar

I have the following code, which generates bar graphs. I want to chance the colors of the first bar of the 3 groups to blue, the second bar of the 3 groups to red and the third bar of the first 2 groups to green. can anyone help me out?
y=[185 145 30;123 100 14;65 67 NaN]; bar(y,1)

Best Answer

c(1,:)=[0 0 1] % blue color
c(2,:)=[1 0 0] % red
c(3,:)=[0 1 0] % green
y=[185 145 30;123 100 14 ;65 67 NaN];
h=bar(y,1)
set(h,{'FaceColor'},num2cell(c,2))