i have 4 classes of size (72,22,22) and i want to do anova1 for each pair of the (22,22) in those classes . for example; i wanna grab, let's say, pair (2,3) in each class and do the anova for each pair in the 4 arrays, so the output would be an array of (22,22)representing P-values of each pair across 4 classes. hopefullay my code explains what i am trying to say :) i have tried this piece of code but im not sure cuz the results are kinda odd; i guess the issue is in 2 for loops. here is the code here is my code :
x = load("plv_8_12.mat");
x = x.plv;
size(x)
ans =
2592 22 22
S1C1 =x(1:72,:,:);
S1C2 = x(649:720,:,:);
S1C3 = x(1297:1368,:,:);
S1C4 = x(1945:2016,:,:);
p_all = [];
for x =1:22
for y=1:22
tc1 = S1C1(:,x,y);
tc2 = S1C2(:,x,y);
tc3 = S1C3(:,x,y);
tc4 = S1C4(:,x,y);
temp = [tc1 tc2 tc3 tc4];
%p_all(x,y) = anova1(temp);
[p,tbl,stats]=anova1(temp);
close all
end
end