Cody

# Problem 44104. Hilbert Scan Algorithm

Solution 2440255

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))

ans = -0.2500 -0.2500 0.2500 0.2500

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test1 (line 3) 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))

ans = -0.3750 -0.1250 -0.1250 -0.3750 -0.3750 -0.3750 -0.1250 -0.1250 0.1250 0.1250 0.3750 0.3750 0.3750 0.1250 0.1250 0.3750

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". 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))

ans = Columns 1 through 18 -0.4688 -0.4062 -0.4062 -0.4688 -0.4688 -0.4688 -0.4062 -0.4062 -0.3438 -0.3438 -0.2812 -0.2812 -0.2812 -0.3438 -0.3438 -0.2812 -0.2188 -0.2188 Columns 19 through 36 -0.1562 -0.1562 -0.0938 -0.0312 -0.0312 -0.0938 -0.0938 -0.0312 -0.0312 -0.0938 -0.1562 -0.1562 -0.2188 -0.2188 -0.2188 -0.2188 -0.1562 -0.1562 Columns 37 through 54 -0.0938 -0.0312 -0.0312 -0.0938 -0.0938 -0.0312 -0.0312 -0.0938 -0.1562 -0.1562 -0.2188 -0.2188 -0.2812 -0.3438 -0.3438 -0.2812 -0.2812 -0.2812 Columns 55 through 72 -0.3438 -0.3438 -0.4062 -0.4062 -0.4688 -0.4688 -0.4688 -0.4062 -0.4062 -0.4688 -0.4688 -0.4688 -0.4062 -0.4062 -0.3438 -0.2812 -0.2812 -0.3438 Columns 73 through 90 -0.3438 -0.2812 -0.2812 -0.3438 -0.4062 -0.4062 -0.4688 -0.4688 -0.4688 -0.4062 -0.4062 -0.4688 -0.4688 -0.4688 -0.4062 -0.4062 -0.3438 -0.3438 Columns 91 through 108 -0.2812 -0.2812 -0.2812 -0.3438 -0.3438 -0.2812 -0.2188 -0.1562 -0.1562 -0.2188 -0.2188 -0.2188 -0.1562 -0.1562 -0.0938 -0.0938 -0.0312 -0.0312 Columns 109 through 126 -0.0312 -0.0938 -0.0938 -0.0312 -0.0312 -0.0312 -0.0938 -0.0938 -0.1562 -0.2188 -0.2188 -0.1562 -0.1562 -0.2188 -0.2188 -0.1562 -0.0938 -0.0938 Columns 127 through 144 -0.0312 -0.0312 0.0312 0.0312 0.0938 0.0938 0.1562 0.2188 0.2188 0.1562 0.1562 0.2188 0.2188 0.1562 0.0938 0.0938 0.0312 0.0312 Columns 145 through 162 0.0312 0.0938 0.0938 0.0312 0.0312 0.0312 0.0938 0.0938 0.1562 0.1562 0.2188 0.2188 0.2188 0.1562 0.1562 0.2188 0.2812 0.3438 Columns 163 through 180 0.3438 0.2812 0.2812 0.2812 0.3438 0.3438 0.4062 0.4062 0.4688 0.4688 0.4688 0.4062 0.4062 0.4688 0.4688 0.4688 0.4062 0.4062 Columns 181 through 198 0.3438 0.2812 0.2812 0.3438 0.3438 0.2812 0.2812 0.3438 0.4062 0.4062 0.4688 0.4688 0.4688 0.4062 0.4062 0.4688 0.4688 0.4688 Columns 199 through 216 0.4062 0.4062 0.3438 0.3438 0.2812 0.2812 0.2812 0.3438 0.3438 0.2812 0.2188 0.2188 0.1562 0.1562 0.0938 0.0312 0.0312 0.0938 Columns 217 through 234 0.0938 0.0312 0.0312 0.0938 0.1562 0.1562 0.2188 0.2188 0.2188 0.2188 0.1562 0.1562 0.0938 0.0312 0.0312 0.0938 0.0938 0.0312 Columns 235 through 252 0.0312 0.0938 0.1562 0.1562 0.2188 0.2188 0.2812 0.3438 0.3438 0.2812 0.2812 0.2812 0.3438 0.3438 0.4062 0.4062 0.4688 0.4688 Columns 253 through 256 0.4688 0.4062 0.4062 0.4688

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". 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))

ans = Columns 1 through 18 -0.4980 -0.4941 -0.4941 -0.4980 -0.4980 -0.4980 -0.4941 -0.4941 -0.4902 -0.4902 -0.4863 -0.4863 -0.4863 -0.4902 -0.4902 -0.4863 -0.4824 -0.4824 Columns 19 through 36 -0.4785 -0.4785 -0.4746 -0.4707 -0.4707 -0.4746 -0.4746 -0.4707 -0.4707 -0.4746 -0.4785 -0.4785 -0.4824 -0.4824 -0.4824 -0.4824 -0.4785 -0.4785 Columns 37 through 54 -0.4746 -0.4707 -0.4707 -0.4746 -0.4746 -0.4707 -0.4707 -0.4746 -0.4785 -0.4785 -0.4824 -0.4824 -0.4863 -0.4902 -0.4902 -0.4863 -0.4863 -0.4863 Columns 55 through 72 -0.4902 -0.4902 -0.4941 -0.4941 -0.4980 -0.4980 -0.4980 -0.4941 -0.4941 -0.4980 -0.4980 -0.4980 -0.4941 -0.4941 -0.4902 -0.4863 -0.4863 -0.4902 Columns 73 through 90 -0.4902 -0.4863 -0.4863 -0.4902 -0.4941 -0.4941 -0.4980 -0.4980 -0.4980 -0.4941 -0.4941 -0.4980 -0.4980 -0.4980 -0.4941 -0.4941 -0.4902 -0.4902 Columns 91 through 108 -0.4863 -0.4863 -0.4863 -0.4902 -0.4902 -0.4863 -0.4824 -0.4785 -0.4785 -0.4824 -0.4824 -0.4824 -0.4785 -0.4785 -0.4746 -0.4746 -0.4707 -0.4707 Columns 109 through 126 -0.4707 -0.4746 -0.4746 -0.4707 -0.4707 -0.4707 -0.4746 -0.4746 -0.4785 -0.4824 -0.4824 -0.4785 -0.4785 -0.4824 -0.4824 -0.4785 -0.4746 -0.4746 Columns 127 through 144 -0.4707 -0.4707 -0.4668 -0.4668 -0.4629 -0.4629 -0.4590 -0.4551 -0.4551 -0.4590 -0.4590 -0.4551 -0.4551 -0.4590 -0.4629 -0.4629 -0.4668 -0.4668 Columns 145 through 162 -0.4668 -0.4629 -0.4629 -0.4668 -0.4668 -0.4668 -0.4629 -0.4629 -0.4590 -0.4590 -0.4551 -0.4551 -0.4551 -0.4590 -0.4590 -0.4551 -0.4512 -0.4473 Columns 163 through 180 -0.4473 -0.4512 -0.4512 -0.4512 -0.4473 -0.4473 -0.4434 -0.4434 -0.4395 -0.4395 -0.4395 -0.4434 -0.4434 -0.4395 -0.4395 -0.4395 -0.4434 -0.4434 Columns 181 through 198 -0.4473 -0.4512 -0.4512 -0.4473 -0.4473 -0.4512 -0.4512 -0.4473 -0.4434 -0.4434 -0.4395 -0.4395 -0.4395 -0.4434 -0.4434 -0.4395 -0.4395 -0.4395 Columns 199 through 216 -0.4434 -0.4434 -0.4473 -0.4473 -0.4512 -0.4512 -0.4512 -0.4473 -0.4473 -0.4512 -0.4551 -0.4551 -0.4590 -0.4590 -0.4629 -0.4668 -0.4668 -0.4629 Columns 217 through 234 -0.4629 -0.4668 -0.4668 -0.4629 -0.4590 -0.4590 -0.4551 -0.4551 -0.4551 -0.4551 -0.4590 -0.4590 -0.4629 -0.4668 -0.4668 -0.4629 -0.4629 -0.4668 Columns 235 through 252 -0.4668 -0.4629 -0.4590 -0.4590 -0.4551 -0.4551 -0.4512 -0.4473 -0.4473 -0.4512 -0.4512 -0.4512 -0.4473 -0.4473 -0.4434 -0.4434 -0.4395 -0.4395 Columns 253 through 270 -0.4395 -0.4434 -0.4434 -0.4395 -0.4355 -0.4355 -0.4316 -0.4316 -0.4277 -0.4238 -0.4238 -0.4277 -0.4277 -0.4238 -0.4238 -0.4277 -0.4316 -0.4316 Columns 271 through 288 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4277 -0.4277 -0.4238 -0.4238 -0.4238 -0.4277 -0.4277 -0.4238 Columns 289 through 306 -0.4199 -0.4160 -0.4160 -0.4199 -0.4199 -0.4199 -0.4160 -0.4160 -0.4121 -0.4121 -0.4082 -0.4082 -0.4082 -0.4121 -0.4121 -0.4082 -0.4082 -0.4082 Columns 307 through 324 -0.4121 -0.4121 -0.4160 -0.4199 -0.4199 -0.4160 -0.4160 -0.4199 -0.4199 -0.4160 -0.4121 -0.4121 -0.4082 -0.4082 -0.4043 -0.4004 -0.4004 -0.4043 Columns 325 through 342 -0.4043 -0.4043 -0.4004 -0.4004 -0.3965 -0.3965 -0.3926 -0.3926 -0.3926 -0.3965 -0.3965 -0.3926 -0.3887 -0.3887 -0.3848 -0.3848 -0.3809 -0.3770 Columns 343 through 360 -0.3770 -0.3809 -0.3809 -0.3770 -0.3770 -0.3809 -0.3848 -0.3848 -0.3887 -0.3887 -0.3887 -0.3887 -0.3848 -0.3848 -0.3809 -0.3770 -0.3770 -0.3809 Columns 361 through 378 -0.3809 -0.3770 -0.3770 -0.3809 -0.3848 -0.3848 -0.3887 -0.3887 -0.3926 -0.3965 -0.3965 -0.3926 -0.3926 -0.3926 -0.3965 -0.3965 -0.4004 -0.4004 Columns 379 through 396 -0.4043 -0.4043 -0.4043 -0.4004 -0.4004 -0.4043 -0.4043 -0.4004 -0.4004 -0.4043 -0.4043 -0.4043 -0.4004 -0.4004 -0.3965 -0.3965 -0.3926 -0.3926 Columns 397 through 414 -0.3926 -0.3965 -0.3965 -0.3926 -0.3887 -0.3887 -0.3848 -0.3848 -0.3809 -0.3770 -0.3770 -0.3809 -0.3809 -0.3770 -0.3770 -0.3809 -0.3848 -0.3848 Columns 415 through 432 -0.3887 -0.3887 -0.3887 -0.3887 -0.3848 -0.3848 -0.3809 -0.3770 -0.3770 -0.3809 -0.3809 -0.3770 -0.3770 -0.3809 -0.3848 -0.3848 -0.3887 -0.3887 Columns 433 through 450 -0.3926 -0.3965 -0.3965 -0.3926 -0.3926 -0.3926 -0.3965 -0.3965 -0.4004 -0.4004 -0.4043 -0.4043 -0.4043 -0.4004 -0.4004 -0.4043 -0.4082 -0.4082 Columns 451 through 468 -0.4121 -0.4121 -0.4160 -0.4199 -0.4199 -0.4160 -0.4160 -0.4199 -0.4199 -0.4160 -0.4121 -0.4121 -0.4082 -0.4082 -0.4082 -0.4121 -0.4121 -0.4082 Columns 469 through 486 -0.4082 -0.4082 -0.4121 -0.4121 -0.4160 -0.4160 -0.4199 -0.4199 -0.4199 -0.4160 -0.4160 -0.4199 -0.4238 -0.4277 -0.4277 -0.4238 -0.4238 -0.4238 Columns 487 through 504 -0.4277 -0.4277 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4277 -0.4238 -0.4238 -0.4277 Columns 505 through 522 -0.4277 -0.4238 -0.4238 -0.4277 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4277 -0.4238 -0.4238 -0.4277 -0.4277 -0.4238 Columns 523 through 540 -0.4238 -0.4277 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4277 -0.4277 -0.4238 -0.4238 Columns 541 through 558 -0.4238 -0.4277 -0.4277 -0.4238 -0.4199 -0.4160 -0.4160 -0.4199 -0.4199 -0.4199 -0.4160 -0.4160 -0.4121 -0.4121 -0.4082 -0.4082 -0.4082 -0.4121 Columns 559 through 576 -0.4121 -0.4082 -0.4082 -0.4082 -0.4121 -0.4121 -0.4160 -0.4199 -0.4199 -0.4160 -0.4160 -0.4199 -0.4199 -0.4160 -0.4121 -0.4121 -0.4082 -0.4082 Columns 577 through 594 -0.4043 -0.4004 -0.4004 -0.4043 -0.4043 -0.4043 -0.4004 -0.4004 -0.3965 -0.3965 -0.3926 -0.3926 -0.3926 -0.3965 -0.3965 -0.3926 -0.3887 -0.3887 Columns 595 through 612 -0.3848 -0.3848 -0.3809 -0.3770 -0.3770 -0.3809 -0.3809 -0.3770 -0.3770 -0.3809 -0.3848 -0.3848 -0.3887 -0.3887 -0.3887 -0.3887 -0.3848 -0.3848 Columns 613 through 630 -0.3809 -0.3770 -0.3770 -0.3809 -0.3809 -0.3770 -0.3770 -0.3809 -0.3848 -0.3848 -0.3887 -0.3887 -0.3926 -0.3965 -0.3965 -0.3926 -0.3926 -0.3926 Columns 631 through 648 -0.3965 -0.3965 -0.4004 -0.4004 -0.4043 -0.4043 -0.4043 -0.4004 -0.4004 -0.4043 -0.4043 -0.4004 -0.4004 -0.4043 -0.4043 -0.4043 -0.4004 -0.4004 Columns 649 through 666 -0.3965 -0.3965 -0.3926 -0.3926 -0.3926 -0.3965 -0.3965 -0.3926 -0.3887 -0.3887 -0.3848 -0.3848 -0.3809 -0.3770 -0.3770 -0.3809 -0.3809 -0.3770 Columns 667 through 684 -0.3770 -0.3809 -0.3848 -0.3848 -0.3887 -0.3887 -0.3887 -0.3887 -0.3848 -0.3848 -0.3809 -0.3770 -0.3770 -0.3809 -0.3809 -0.3770 -0.3770 -0.3809 Columns 685 through 702 -0.3848 -0.3848 -0.3887 -0.3887 -0.3926 -0.3965 -0.3965 -0.3926 -0.3926 -0.3926 -0.3965 -0.3965 -0.4004 -0.4004 -0.4043 -0.4043 -0.4043 -0.4004 Columns 703 through 720 -0.4004 -0.4043 -0.4082 -0.4082 -0.4121 -0.4121 -0.4160 -0.4199 -0.4199 -0.4160 -0.4160 -0.4199 -0.4199 -0.4160 -0.4121 -0.4121 -0.4082 -0.4082 Columns 721 through 738 -0.4082 -0.4121 -0.4121 -0.4082 -0.4082 -0.4082 -0.4121 -0.4121 -0.4160 -0.4160 -0.4199 -0.4199 -0.4199 -0.4160 -0.4160 -0.4199 -0.4238 -0.4277 Columns 739 through 756 -0.4277 -0.4238 -0.4238 -0.4238 -0.4277 -0.4277 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 -0.4355 -0.4355 -0.4355 -0.4316 -0.4316 Columns 757 through 774 -0.4277 -0.4238 -0.4238 -0.4277 -0.4277 -0.4238 -0.4238 -0.4277 -0.4316 -0.4316 -0.4355 -0.4355 -0.4395 -0.4434 -0.4434 -0.4395 -0.4395 -0.4395 Columns 775 through 792 -0.4434 -0.4434 -0.4473 -0.4473 -0.4512 -0.4512 -0.4512 -0.4473 -0.4473 -0.4512 -0.4551 -0.4551 -0.4590 -0.4590 -0.4629 -0.4668 -0.4668 -0.4629 Columns 793 through 810 -0.4629 -0.4668 -0.4668 -0.4629 -0.4590 -0.4590 -0.4551 -0.4551 -0.4551 -0.4551 -0.4590 -0.4590 -0.4629 -0.4668 -0.4668 -0.4629 -0.4629 -0.4668 Columns 811 through 828 -0.4668 -0.4629 -0.4590 -0.4590 -0.4551 -0.4551 -0.4512 -0.4473 -0.4473 -0.4512 -0.4512 -0.4512 -0.4473 -0.4473 -0.4434 -0.4434 -0.4395 -0.4395 Columns 829 through 846 -0.4395 -0.4434 -0.4434 -0.4395 -0.4395 -0.4395 -0.4434 -0.4434 -0.4473 -0.4512 -0.4512 -0.4473 -0.4473 -0.4512 -0.4512 -0.4473 -0.4434 -0.4434 Columns 847 through 864 -0.4395 -0.4395 -0.4395 -0.4434 -0.4434 -0.4395 -0.4395 -0.4395 -0.4434 -0.4434 -0.4473 -0.4473 -0.4512 -0.4512 -0.4512 -0...

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". 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!