To vectorize a summatory like
u(x,y) = \sum_{i,j} c_{i,j} sin(ix) sin(jy)
I've used this code:
for i = 1:k
Fx(i,:) = sin(i*x);
Fy(i,:) = sin(i*y);
end;
u = Fx'*C*Fy;
where C is a matrix with elements C(i,j) = c_{i,j}
Now I have to do a summatory like
u(x,y) = \sum_{i,j} c_{i,j} J_j(\omega_{i,j}*x) cos(j*y)
I've used this code:
for n = 1:N
Fy(n,:) = cos((n-1)*y);
for k = 1:K
Fx(k,:,n) = besselj(n-1,omega(n,k)*x);
end;
end;
upartial = zeros(ms,ms);
for n = 1:N
upartial = upartial + Fx(:,:,n)'*CF(n,:)'*Fy(n,:);
end;
u= upartial;