Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
n = 1;
c_correct = 1;
assert(isequal(collatz(n),c_correct))
|
2 | Pass |
n = 2;
c_correct = [2 1];
assert(isequal(collatz(n),c_correct))
next =
1
|
3 | Pass |
n = 5;
c_correct = [5 16 8 4 2 1];
assert(isequal(collatz(n),c_correct))
next =
16
next =
8
next =
4
next =
2
next =
1
|
4 | Pass |
n = 22;
c_correct = [22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1];
assert(isequal(collatz(n),c_correct))
next =
11
next =
34
next =
17
next =
52
next =
26
next =
13
next =
40
next =
20
next =
10
next =
5
next =
16
next =
8
next =
4
next =
2
next =
1
|
337 Solvers
Reverse the Words (not letters) of a String
297 Solvers
Project Euler: Problem 9, Pythagorean numbers
282 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
546 Solvers
Celsius to Fahrenheit converter
388 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!