Cody

Problem 2168. Positive Infinity

Solution 2857049

Submitted on 20 Aug 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
a = [2.5 -1.7 5.6 8.4] y_correct = [ 3 -1 6 9]; assert(isequal(positiveround(a),y_correct)) a = [ -105.25 78.89 -0.1 0.9 7.2] y_correct = [ -105 79 0 1 8] assert(isequal(positiveround(a),y_correct)) a = [ 265.25 88.99 -0.1 0.9 7.2] y_correct = [ 266 89 0 1 8] assert(isequal(positiveround(a),y_correct))

a = 2.5000 -1.7000 5.6000 8.4000

Unrecognized function or variable 'x'. Error in positiveround (line 2) y = ceil(x); Error in Test1 (line 3) assert(isequal(positiveround(a),y_correct))

Suggested Problems

More from this Author4

Community Treasure Hunt

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

Start Hunting!