Cody

# Problem 1128. Simple return on investment

Solution 1271071

Submitted on 19 Sep 2017
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
x = [721;702;703;698;692;705;714;729;735;750]; y_correct = 4.02; assert(isequal(simple_return(x),y_correct))

Undefined function 'roundn' for input arguments of type 'double'. Error in simple_return (line 2) y = roundn((x(end)/x(1)-1)*100,-2); Error in Test1 (line 3) assert(isequal(simple_return(x),y_correct))

2   Fail
x = [145;147;147;146;144;145;144;145;144;145;145;145;144;140;143;144;148;143;145;145;144;142;142;145;144;145;147;146;146;147;147;144]; y_correct = -0.69; assert(isequal(simple_return(x),y_correct))

Undefined function 'roundn' for input arguments of type 'double'. Error in simple_return (line 2) y = roundn((x(end)/x(1)-1)*100,-2); Error in Test2 (line 3) assert(isequal(simple_return(x),y_correct))

### Community Treasure Hunt

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

Start Hunting!