Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 1;
y_correct = 1;
assert(isequal(your_fcn_name(x),y_correct))
x = 5;
y_correct = [21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13];
assert(isequal(your_fcn_name(x),y_correct))
x = 9;
y_correct = [ 73 74 75 76 77 78 79 80 81
72 43 44 45 46 47 48 49 50
71 42 21 22 23 24 25 26 51
70 41 20 7 8 9 10 27 52
69 40 19 6 1 2 11 28 53
68 39 18 5 4 3 12 29 54
67 38 17 16 15 14 13 30 55
66 37 36 35 34 33 32 31 56
65 64 63 62 61 60 59 58 57]
assert(isequal(your_fcn_name(x),y_correct))
ans =
1
ans =
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
y_correct =
73 74 75 76 77 78 79 80 81
72 43 44 45 46 47 48 49 50
71 42 21 22 23 24 25 26 51
70 41 20 7 8 9 10 27 52
69 40 19 6 1 2 11 28 53
68 39 18 5 4 3 12 29 54
67 38 17 16 15 14 13 30 55
66 37 36 35 34 33 32 31 56
65 64 63 62 61 60 59 58 57
ans =
73 74 75 76 77 78 79 80 81
72 43 44 45 46 47 48 49 50
71 42 21 22 23 24 25 26 51
70 41 20 7 8 9 10 27 52
69 40 19 6 1 2 11 28 53
68 39 18 5 4 3 12 29 54
67 38 17 16 15 14 13 30 55
66 37 36 35 34 33 32 31 56
65 64 63 62 61 60 59 58 57
|
Number of 1s in the Binary Representation of a Number
356 Solvers
Get the length of a given vector
3558 Solvers
376 Solvers
Calculate the height of an object dropped from the sky
165 Solvers
559 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!