FAQ/RMWW_Mlab22017-08-25 09:12:58PeterWatson12017-08-25 09:11:26PeterWatsonFitting an ANOVA with two repeated measures factors in MATLABMATLAB code below for two repeated measures factors written by Adam Schurger and taken from here. Clicking on the 'overview' tab at the website above gives further details. 3stdev, etc...).
for i=1:a % F1
for j=1:b % F2
for k=1:n % Subjs
INDS{i,j,k} = find(F1==F1_lvls(i) & F2==F2_lvls(j) & S==Subjs(k));
CELLS{i,j,k} = Y(INDS{i,j,k});
MEANS(i,j,k) = mean(CELLS{i,j,k});
end
end
end
]]>