how can i do this summation

I have two summation ,a=0 to a=m+1 and b=0 to b=n+1,where m=100,n=50.?

댓글 수: 8

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 18일
If m=2 and n=3 what should be the result?
Mary Jon
Mary Jon 2013년 9월 18일
편집: Mary Jon 2013년 9월 18일
I am not need sum 3 with 2 to get 5 . I need summation from 0 to m+1,and from 0 to n+1,where n=50,m=100
Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 18일
Ok, show us the result for m=3 and n=2
Mary Jon
Mary Jon 2013년 9월 18일
my function is M=sum(a=0 to a=m+1)sum (b=0 to b=n+1)(abs(fun(m)-fun(n)) I don't know result for m=3 and n=2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 18일
This is not clear
Mary Jon
Mary Jon 2013년 9월 18일
편집: Azzi Abdelmalek 2013년 9월 18일
MPD=(∑_(a=0, n+1)∑_(b=0,m+1)|(v_(i,j)^(k+1)-(v_(i,j))^(k) |))/((m.n))
Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 18일
a and b are not used in your sum. What are i and j? what is k?
Mary Jon
Mary Jon 2013년 9월 18일
편집: Azzi Abdelmalek 2013년 9월 18일
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)

댓글을 달려면 로그인하십시오.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 18일
편집: Azzi Abdelmalek 2013년 9월 18일

1 개 추천

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)

추가 답변 (2개)

Walter Roberson
Walter Roberson 2013년 9월 18일

0 개 추천

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

matlab error
??? Undefined command/function 'arrayfun'. ??? Undefined command/function 'bsxfun'.
I am using matlab 7
Walter Roberson
Walter Roberson 2013년 9월 18일
MATLAB 7... you mean R14? Is it at least R14SP1 ?
Mary Jon
Mary Jon 2013년 9월 20일
yes,I mean R14

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Function Creation에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by