Filter löschen
Filter löschen

how can i do this summation

1 Ansicht (letzte 30 Tage)
Mary Jon
Mary Jon am 18 Sep. 2013
I have two summation ,a=0 to a=m+1 and b=0 to b=n+1,where m=100,n=50.?
  8 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 18 Sep. 2013
a and b are not used in your sum. What are i and j? what is k?
Mary Jon
Mary Jon am 18 Sep. 2013
Bearbeitet: Azzi Abdelmalek am 18 Sep. 2013
sorry sorry
MPD=(∑_(a=0, n+1)∑_(b=0,m+1)|(v_(a,b)^(k+1)-(v_(a,b))^(k) |))/((m.n))
k=1:88(as ex)
how do it (writing)

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 18 Sep. 2013
Bearbeitet: Azzi Abdelmalek am 18 Sep. 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)

Weitere Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 18 Sep. 2013
m=100
out=sum(0:m)

Walter Roberson
Walter Roberson am 18 Sep. 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 Kommentare
Walter Roberson
Walter Roberson am 18 Sep. 2013
MATLAB 7... you mean R14? Is it at least R14SP1 ?
Mary Jon
Mary Jon am 20 Sep. 2013
yes,I mean R14

Melden Sie sich an, um zu kommentieren.

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by