what's wrong with my answer? it gives exactly the right answer just not in []
also the test suite says it gives you x but when you use x in the function it doesn't recognize x you have to use n
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
x = 2;
y_correct = [1 2 2];
assert(isequal(your_fcn_name(x),y_correct))
y =
[]
y =
1 2 2
|
2 | Fail |
x = 5;
y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5];
assert(isequal(your_fcn_name(x),y_correct))
y =
[]
y =
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
|
3 | Fail |
x = 10;
y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ...
6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ...
9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10];
assert(isequal(your_fcn_name(x),y_correct))
y =
[]
y =
Columns 1 through 30
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8
Columns 31 through 55
8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10
|
4 | Fail |
x = 12;
y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ...
6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ...
9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ...
11 11 11 11 11 11 11 11 11 11 11 ...
12 12 12 12 12 12 12 12 12 12 12 12];
assert(isequal(your_fcn_name(x),y_correct))
y =
[]
y =
Columns 1 through 30
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8
Columns 31 through 60
8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11
Columns 61 through 78
11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12
|
5 | Fail |
x = 9;
y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ...
6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ...
9 9 9 9 9 9 9 9 9];
assert(isequal(your_fcn_name(x),y_correct))
y =
[]
y =
Columns 1 through 30
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8
Columns 31 through 45
8 8 8 8 8 8 9 9 9 9 9 9 9 9 9
|
6 | Fail |
x = 7;
y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ...
6 6 6 6 6 6 7 7 7 7 7 7 7];
assert(isequal(your_fcn_name(x),y_correct))
y =
[]
y =
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7
|
7 | Fail |
x = 15;
y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ...
6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ...
9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ...
11 11 11 11 11 11 11 11 11 11 11 ...
12 12 12 12 12 12 12 12 12 12 12 12 ...
13 13 13 13 13 13 13 13 13 13 13 13 13 ...
14 14 14 14 14 14 14 14 14 14 14 14 14 14 ...
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15];
assert(isequal(your_fcn_name(x),y_correct))
y =
[]
y =
Columns 1 through 30
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8
Columns 31 through 60
8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11
Columns 61 through 90
11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13
Columns 91 through 120
13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
|
1836 Solvers
1963 Solvers
327 Solvers
569 Solvers
2634 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!