Efficient way to implement a Summation within an Integral

2 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by