Cody

Solution 1421419

Submitted on 21 Jan 2018 by MDK
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
data=[... 1 3 6 7 9 3 5 6 9 1]; output_correct =[... 1 3 6 7 9 3 5 6 9 1 2 4 6 8 5]; assert(isequal(check_ave(data),output_correct))

r = 2 c = 5 ave = 26 ave = 26 ave = 2 4 6 8 5 output = 1 3 6 7 9 3 5 6 9 1 2 4 6 8 5

2   Pass
data=[... 1 3 6 7 9 3 5 6 9 1 2 4 6 8 5]; output_correct = data; assert(isequal(check_ave(data),output_correct))

r = 3 c = 5 ave = 2 4 6 8 5 ave = 2 4 6 8 5 output = 1 3 6 7 9 3 5 6 9 1 2 4 6 8 5

3   Pass
data=[... 2 3 0 0 6 1 3 6 0 1 3 3 6 9 2 2 3 4 3 3]; output_correct = data; assert(isequal(check_ave(data),output_correct))

r = 4 c = 5 ave = 2 3 4 3 3 ave = 2 3 4 3 3 output = 2 3 0 0 6 1 3 6 0 1 3 3 6 9 2 2 3 4 3 3

4   Pass
data=[... 2 3 0 0 6 1 3 6 0 1 3 3 6 9 2]; output_correct =[... 2 3 0 0 6 1 3 6 0 1 3 3 6 9 2 2 3 4 3 3]; assert(isequal(check_ave(data),output_correct))

r = 3 c = 5 ave = 1.5000 3.0000 3.0000 0 3.5000 ave = 1.5000 3.0000 3.0000 0 3.5000 ave = 2 3 4 3 3 output = 2 3 0 0 6 1 3 6 0 1 3 3 6 9 2 2 3 4 3 3

5   Pass
data = [1:1000;999:-1:0]; output_correct =[data;repmat(500,1,1000)]; assert(isequal(check_ave(data),output_correct))

r = 2 c = 1000 ave = 500500 ave = 500500 ave = Columns 1 through 29 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 30 through 58 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 59 through 87 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 88 through 116 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 117 through 145 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 146 through 174 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 175 through 203 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 204 through 232 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 233 through 261 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 262 through 290 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 291 through 319 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 320 through 348 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 349 through 377 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 378 through 406 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 407 through 435 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 436 through 464 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 465 through 493 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 494 through 522 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 523 through 551 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 552 through 580 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 581 through 609 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 610 through 638 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 639 through 667 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 668 through 696 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 697 through 725 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 726 through 754 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 755 through 783 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 784 through 812 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 813 through 841 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 842 through 870 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 871 through 899 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 900 through 928 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 929 through 957 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 958 through 986 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 987 through 1000 500 500 500 500 500 500 500 500 500 500 500 500 500 500 output = Columns 1 through 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 999 998 997 996 995 994 993 992 991 990 989 988 987 986 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 15 through 28 15 16 17 18 19 20 21 22 23 24 25 26 27 28 985 984 983 982 981 980 979 978 977 976 975 974 973 972 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 29 through 42 29 30 31 32 33 34 35 36 37 38 39 40 41 42 971 970 969 968 967 966 965 964 963 962 961 960 959 958 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 43 through 56 43 44 45 46 47 48 49 50 51 52 53 54 55 56 957 956 955 954 953 952 951 950 949 948 947 946 945 944 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 57 through 70 57 58 59 60 61 62 63 64 65 66 67 68 69 70 943 942 941 940 939 938 937 936 935 934 933 932 931 930 500 500 500 500 500 500 500 500 500 500 500 500 500 500 Columns 71 through 84 71 72 73 74 75 76 77 78 79 80 81 82 83 84 929 928 927 ...

Suggested Problems

More from this Author12