Cody

Solution 1477628

Submitted on 3 Apr 2018
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 = 4; y_correct = [16 3 2 13;5 10 11 8;9 6 7 12;4 15 14 1] assert(isequal(magic_mat(x),y_correct))

y_correct = 16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1

Index exceeds array bounds. Error in magic_mat (line 2) x(str2num('1 6 11 16 2 3 5 8 12 9 14 15'))=x(str2num('fliplr([1 6 11 16]) 5 9 2 14 15 3 8 12')); Error in Test1 (line 3) assert(isequal(magic_mat(x),y_correct))