Cody

# Problem 44104. Hilbert Scan Algorithm

Solution 2073027

Submitted on 28 Dec 2019
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
x = 1; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

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

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in your_fcn_name (line 4) xo = n+1-((2^(m+1))*y+n+1)/2; Error in Test2 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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 using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in your_fcn_name (line 4) xo = n+1-((2^(m+1))*y+n+1)/2; Error in Test3 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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 using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in your_fcn_name (line 4) xo = n+1-((2^(m+1))*y+n+1)/2; Error in Test4 (line 4) assert(isequal(your_fcn_name(x),y_correct))

### Community Treasure Hunt

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

Start Hunting!