Given x and n, compute the following sum:
Thus, if x = 0.1 and n = 5, then the sum is (up to n = 5 terms)
0.1+2*(0.01)+3*(0.001)+4*(0.0001)+5*(0.00001)
= 0.12345
Avoid using for/while loops.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers38
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
9132 Solvers
-
Find the alphabetic word product
3457 Solvers
-
Change the sign of even index entries of the reversed vector
640 Solvers
-
707 Solvers
-
529 Solvers
More from this Author52
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Please, do not use isqual with floats, instead use abs(x1-x2) < 1e-10 for instance. A number like 0.1 is infinite and periodic in base 2.
The test suite is updated to use a tolerance check.