Cody

# Problem 1219. Mystery problem

Solution 934935

Submitted on 11 Aug 2016
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   Pass
assert(isequal(mystery(1:5),[111 301 315 2301 2325]))

V = 1.0e+03 * Columns 1 through 9 0.1110 0.3010 0.3150 2.3010 2.3250 0.8090 2.1200 1.4130 1.4220 Columns 10 through 18 1.3200 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 Columns 19 through 27 0.7048 0.7048 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 28 through 36 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 37 through 41 1.8090 1.3190 1.2010 0.4050 0.6120

2   Pass
assert(isequal(mystery(6:10),[809 2120 1413 1422 1320]))

V = 1.0e+03 * Columns 1 through 9 0.1110 0.3010 0.3150 2.3010 2.3250 0.8090 2.1200 1.4130 1.4220 Columns 10 through 18 1.3200 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 Columns 19 through 27 0.7048 0.7048 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 28 through 36 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 37 through 41 1.8090 1.3190 1.2010 0.4050 0.6120

3   Fail
assert(isequal(mystery(46:50),[1809 1319 1201 405 612]))

V = 1.0e+03 * Columns 1 through 9 0.1110 0.3010 0.3150 2.3010 2.3250 0.8090 2.1200 1.4130 1.4220 Columns 10 through 18 1.3200 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 Columns 19 through 27 0.7048 0.7048 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 28 through 36 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 37 through 41 1.8090 1.3190 1.2010 0.4050 0.6120

Error using mystery (line 3) Index exceeds matrix dimensions.

4   Fail
x=1:50; m=mystery(x); assert(all(m==round(m))) y=spline(x,m,[12.5 37.5]); assert(all(y==[704.84846527373202 1283.5708406360138]))

V = 1.0e+03 * Columns 1 through 9 0.1110 0.3010 0.3150 2.3010 2.3250 0.8090 2.1200 1.4130 1.4220 Columns 10 through 18 1.3200 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 0.7048 Columns 19 through 27 0.7048 0.7048 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 28 through 36 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 1.2836 Columns 37 through 41 1.8090 1.3190 1.2010 0.4050 0.6120

Error using mystery (line 3) Index exceeds matrix dimensions.