"Reiman sum Help"

I am using MATLAB and I am tring to do a Reiman Sum I keep getting an error saying:
"
???Error using ==> mtimes
Inner matrix dimensions must agree.
"
My code is: {
n1 = [0:1:50];
N1 = 1 ./ ((2 .* n1 + 1)*(2 .* n1 + 2));
N1Sum = sum(N1) } I don't see the problem and have tried several variations. Does anyone see my error?

 채택된 답변

Walter Roberson
Walter Roberson 2012년 7월 8일

0 개 추천

N1 = 1 ./ ((2 .* n1 + 1) .* (2 .* n1 + 2));
Notice the .* instead of *

댓글 수: 1

Ian
Ian 2012년 7월 8일
This suggestion corrected the problem. Thanks

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

추가 답변 (0개)

카테고리

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

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by