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];
big_yellow = [289 289 300 402 251 389 422 332 360 422];
big_red = [210 229 300 301 200 340 350 290 317 320];
big_black = [226 220 253 218 260 228 380 300 221 211];
X=[small_yellow small_red small_black big_yellow big_red big_black]';
nsubj=10;
nlevelsSize=2;
nlevelColor=3;
Subj=repmat(1:nsubj,1,nlevelsSize*nlevelColor)';
sizesmall=repmat({'small'},1,nlevelColor*nsubj)';
sizebig=repmat({'big'}, 1,nlevelColor*nsubj)';
Size= [sizesmall' sizebig']';
Colyellow=repmat({'yellow'},nsubj,1);
Colred=repmat({'red'},nsubj,1);
Colblack=repmat({'black'},nsubj,1);
Color= [Colyellow' Colred' Colblack' Colyellow' Colred' Colblack']';
[p table stats terms]=anovan(X,{Size Color Subj}, 'random', 3, 'model', 2, ...
'varnames', {'Size' 'Color' 'Subj'});
multcompare(stats,'dimension', [1 2])