Efficient way to implement a Summation within an Integral
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi i'm trying to implement the following equation efficiently, where
is the normalized column vector

The following is my implementation
% function for normalize column vector
nc = @(col) col./norm(col);
% implementation of equation in picture
for m=1:size(Cs,2)
ftemp = [];
for l = 1:size(Cs,2)
if l ~= m % calculation of integral for every l neq to m
fun1 = @(k)(((nc(Cs(:,m)))-(nc(Cs(:,l)).*exp(1j*k)))./(norm(((nc(Cs(:,m)))-(nc(Cs(:,l)).*exp(1j*k))),v)));
fint1 = integral(fun1,0,2*pi,'ArrayValued',true);
ftemp = [ftemp,fint1];
end
end
% cal the sum for every mth value
F(:,m) = sum(ftemp,2);
end
I am a bit worried if the summation under the condition is implemented right, is there a way to cross verify and also a better and more efficient way to do the sum inside integrals ???
Please advice.
0 commentaires
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!