yellow = [300 287 301 400 211 399 412 312 390 412];
red = [240 259 302 311 210 402 390 298 347 380];
black = [ 210 230 213 210 220 208 290 300 201 201];
nsubj=10;
ncond=3;
s=repmat(1:nsubj,ncond,1);
col=repmat(1:ncond,nsubj,1);
X=[yellow; red; black];
X=reshape(X,nsubj*ncond,1);
Subj=reshape(s,nsubj*ncond,1);
Color=reshape(col',nsubj*ncond,1);
[p table stats]=anovan(X,{Color Subj},'random',2);
multcompare(stats)