Unfortunately I'm stucking again with this summation (it's part of my fitness function):

My code with for loops looks like this:
summand = 0;
for w = 1:W
for k = 1:K
for l = 1:K
for m = 1:M
for n = 1:M
summand = summand + dis(k,l) * trcst(m,n) * y(m,k,w) * y(n,l,w);
end
end
end
end
end
With W=3, K=10, M=21. So far it works fine, but now i also want to reformulate the code without the for loops and thats the point I'm stucking.
