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
2013년 9월 18일
If m=2 and n=3 what should be the result?
Azzi Abdelmalek
2013년 9월 18일
Ok, show us the result for m=3 and n=2
Mary Jon
2013년 9월 18일
Azzi Abdelmalek
2013년 9월 18일
This is not clear
Mary Jon
2013년 9월 18일
편집: Azzi Abdelmalek
2013년 9월 18일
Azzi Abdelmalek
2013년 9월 18일
a and b are not used in your sum. What are i and j? what is k?
Mary Jon
2013년 9월 18일
편집: Azzi Abdelmalek
2013년 9월 18일
채택된 답변
추가 답변 (2개)
Azzi Abdelmalek
2013년 9월 18일
m=100
out=sum(0:m)
Walter Roberson
2013년 9월 18일
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
Mary Jon
2013년 9월 18일
Walter Roberson
2013년 9월 18일
MATLAB 7... you mean R14? Is it at least R14SP1 ?
Mary Jon
2013년 9월 20일
카테고리
도움말 센터 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!