Cody

Problem 44104. Hilbert Scan Algorithm

Solution 2440243

Submitted on 31 May 2020
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 = 1; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 26 Column: 1 The function "hilbert" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

2   Fail
x =[1 2; 3 4]; y_correct = [3 1 2 4]; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 26 Column: 1 The function "hilbert" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

3   Fail
x = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]; y_correct = [13 14 10 9 5 1 2 6 7 3 4 8 12 11 15 16]; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 26 Column: 1 The function "hilbert" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

4   Fail
x =magic(8); y_correct = [8 49 15 58 59 5 52 14 22 44 29 35 34 23 41 32 40 26 47 17 9 64 2 55 54 3 61 12 20 46 27 37 36 30 43 21 ... 13 60 6 51 50 7 57 16 24 42 31 33 25 48 18 39 38 28 45 19 11 53 4 62 63 10 56 1]; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 26 Column: 1 The function "hilbert" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

Suggested Problems

More from this Author14

Community Treasure Hunt

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

Start Hunting!