how can i do this summation
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have two summation ,a=0 to a=m+1 and b=0 to b=n+1,where m=100,n=50.?
8 comentarios
Azzi Abdelmalek
el 18 de Sept. de 2013
a and b are not used in your sum. What are i and j? what is k?
Mary Jon
el 18 de Sept. de 2013
Editada: Azzi Abdelmalek
el 18 de Sept. de 2013
Respuesta aceptada
Azzi Abdelmalek
el 18 de Sept. de 2013
Editada: Azzi Abdelmalek
el 18 de Sept. de 2013
s=zeros(1,88);
for k=1:88
for a=0:n+1
for b=0:m+1
s(k)=s(k)+v(a+1,b+1)^(k+1)-v(a+1,b+1)^k
end
end
end
s=s/(m*n)
0 comentarios
Más respuestas (2)
Walter Roberson
el 18 de Sept. de 2013
Supposing that f(a,b) gives you the term you are summing, then
[A, B] = ndgrid(0:m+1, 0:n+1);
fAB = arrayfun(@f, A, B);
sum(fAB(:))
or
fAB = bsxfun(@f, (0:m+1).', 0:n+1);
sum(fAB(:))
3 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!