Cody

# Problem 1219. Mystery problem

Solution 589679

Submitted on 2 Mar 2015 by Yalong Liu
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]))

ans = Columns 1 through 8 111 301 315 2301 2325 809 2120 1413 Columns 9 through 16 1422 1320 904 126 1518 2024 1904 1403 Columns 17 through 24 2014 1408 2201 1405 1425 1305 1511 2322 Columns 25 through 32 701 2220 1125 1119 1903 1404 1301 1304 Columns 33 through 40 1601 118 112 320 1314 1309 2309 1410 Columns 41 through 48 1315 901 1508 914 912 1809 1319 1201 Columns 49 through 50 405 612 ans = 111 301 315 2301 2325

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

ans = Columns 1 through 8 111 301 315 2301 2325 809 2120 1413 Columns 9 through 16 1422 1320 904 126 1518 2024 1904 1403 Columns 17 through 24 2014 1408 2201 1405 1425 1305 1511 2322 Columns 25 through 32 701 2220 1125 1119 1903 1404 1301 1304 Columns 33 through 40 1601 118 112 320 1314 1309 2309 1410 Columns 41 through 48 1315 901 1508 914 912 1809 1319 1201 Columns 49 through 50 405 612 ans = 809 2120 1413 1422 1320

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

ans = Columns 1 through 8 111 301 315 2301 2325 809 2120 1413 Columns 9 through 16 1422 1320 904 126 1518 2024 1904 1403 Columns 17 through 24 2014 1408 2201 1405 1425 1305 1511 2322 Columns 25 through 32 701 2220 1125 1119 1903 1404 1301 1304 Columns 33 through 40 1601 118 112 320 1314 1309 2309 1410 Columns 41 through 48 1315 901 1508 914 912 1809 1319 1201 Columns 49 through 50 405 612 ans = 1809 1319 1201 405 612

4   Pass
%% 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]))

ans = Columns 1 through 8 111 301 315 2301 2325 809 2120 1413 Columns 9 through 16 1422 1320 904 126 1518 2024 1904 1403 Columns 17 through 24 2014 1408 2201 1405 1425 1305 1511 2322 Columns 25 through 32 701 2220 1125 1119 1903 1404 1301 1304 Columns 33 through 40 1601 118 112 320 1314 1309 2309 1410 Columns 41 through 48 1315 901 1508 914 912 1809 1319 1201 Columns 49 through 50 405 612 ans = Columns 1 through 8 111 301 315 2301 2325 809 2120 1413 Columns 9 through 16 1422 1320 904 126 1518 2024 1904 1403 Columns 17 through 24 2014 1408 2201 1405 1425 1305 1511 2322 Columns 25 through 32 701 2220 1125 1119 1903 1404 1301 1304 Columns 33 through 40 1601 118 112 320 1314 1309 2309 1410 Columns 41 through 48 1315 901 1508 914 912 1809 1319 1201 Columns 49 through 50 405 612