Problem 566. Sum of first n terms of a harmonic progression
Solution Stats
Problem Comments

14 Comments
I didn't know "roundn". Thanks.
My solution is correct BUT the test cases result in error due to the roundn() function.
Please solve the situation with the test cases. Same issues as the other people commenting. Problems with roundn.
Please update the tests to deal with the "roundn" issue.
I thought roundn may have been replaced in the latest version of MATLAB, but it seems to still be present in 2017a. Any idea why it's not working in the Cody interpreter?
There is a bug in the tests.
Please fix the issue of roundn
the matlab2017b does have the " roundn" function ,
all the functions are combined with the "round" function .
The tests have bugs in them. Please correct them as soon as possible.
Fix the issue of roundn. The test cases are not working.
The roundn function is not recognized. The test cases are not working.
This test has a problem with roundn function. I have also tried to use elseif and insert the exact values of s, but it doesn't work.
@srivardhini Kindly look into the issue
The test suite has been updated and the problem should function properly now. Various recent solutions were tested and did work. Feel free to resubmit prior solutions.
Solution Comments

1 Comment
This is bullshit, of course. Accepted only because of a bug in the test suite. Argument 2 to the round function should be 4, not 4!

1 Comment
Undefined function 'roundn' for input arguments of type 'double'.
Error in Test2 (line 2)
y_correct = roundn(3.5746,4);

1 Comment
Test suite is using a function not supported for double precision numbers! The poster should rethink!

1 Comment
I am geting an error on the function roundn that is on Test 2 and Test 3, my version on matlab gives the y_correct but here doesnt accept

1 Comment
I'm getting an undefined function error for 'roundn' in your test suite. What gives?

1 Comment
Why am I getting the following message:
Undefined function 'roundn' for input arguments of type 'double'.

1 Comment
Why does it not pass the test Suite?

1 Comment
there is a problem here please update the tests to be matched with the results..

1 Comment
Undefined function 'roundn' for input arguments of type 'double'. Error in Test2 (line 2) y_correct = roundn(3.5746,4);
the problem is in the (line 2) ??!!

1 Comment
the second and third tests in the test suite are using an undefined function roundn. This is causing those test cases to crash, please fix this problem. You can either remove the use of roundn, or provide the test case with the functions code.

2 Comments
its showing an error that i can't understand , i did this problem correctly. But still showing an error,"Undefined function 'roundn' for input arguments of type double"
Please solve the situation with the test cases. Same issues as the other people commenting. Problems with roundn.

1 Comment
Undefined function 'roundn' for input arguments of type 'double'. Error in Test2 (line 2) y_correct = roundn(3.5746,4); ???

3 Comments
My function is correct but the system using the function roundnand have a error:
Undefined function 'roundn' for input arguments of type 'double'. Error in TestPoint2 (line 2) y_correct = roundn(3.5746,4);
???????????????????????
My function is correct but the system using the function roundn and have a error:
Undefined function 'roundn' for input arguments of type 'double'. Error in TestPoint2 (line 2) y_correct = roundn(3.5746,4); ???????????????????????
I am getting the same problem. The test case function roundn() is undefined.

1 Comment
Is there trick to push
function y = roundn(x,n)
y = round( x, n );
end
into Cody?

1 Comment
I don't think the second test case is correct.
Problem Recent Solvers353
Suggested Problems

1843 Solvers

Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
198 Solvers

612 Solvers

434 Solvers

694 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!