"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?

 采纳的回答

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 中查找有关 Data Type Identification 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by