test = rand(4,4,4,4) + rand(4,4,4,4)*1i;
test2a = zeros(4,4,4,4); test2b = zeros(4,4,4,4);
for a = 1:4
for b = 1:4
for c = 1:4
for d = 1:4
test2a(a,b,c,d) = test(a,b,d,c);
test2b(a,b,c,d) = test(b,a,c,d);
end
end
end
end
test3a = permute(test,[1,2,4,3]);
test3b = permute(test,[2,1,3,4]);
m1=max(test2a(:)-test3a(:))
m2=max(test2b(:)-test3b(:))
test2a = zeros(4,4,4,4); test2b = zeros(4,4,4,4);
for a = 1:4
for b = 1:4
for c = 1:4
for d = 1:4
test2a(a,b,c,d) = test(d,b,a,c);
test2b(a,b,c,d) = test(c,a,b,d);
end
end
end
end
test3a = permute(test,[4,2,1,3]);
test3b = permute(test,[3,1,2,4]);
m3=max(test2a(:)-test3a(:))
m4=max(test2b(:)-test3b(:))
m1 =
0