Why does the RSUMS function from the Symbolic Math Toolbox return an incorrect result when I specify a range over which to integrate?

1 view (last 30 days)
If I call the RSUMS function using the syntax:
syms x
rsums(x, 0, 10)
I receive a value of 5, which is incorrect. The value should be 50.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This has been verified as a bug within the RSUMS function in the Symbolic Math Toolbox when called with an integration range. This bug has been fixed in the Symbolic Math Toolbox 3.1 (R14).
As a workaround, replace line 37 of the file :
$MATLAB\toolbox\symbolic\rsums.m
(where $MATLAB is your MATLAB root directory) with the following line:
r = (b-a)*sum(y)/n;
Then, execute the following command at the MATLAB prompt:
rehash toolboxcache

More Answers (0)

Community Treasure Hunt

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

Start Hunting!