Cody

Solution 1999433

Submitted on 2 Nov 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   Fail
assert(isequal(pfactors(5),[]))

a = 5 a = [] y = 0×1 empty double column vector

Assertion failed.

2   Pass
assert(isequal(pfactors(10),[2 5]))

a = 2 5 a = 2 5 b = 5 b = 5 2 y = 2 5

3   Pass
assert(isequal(pfactors(12),[2 3 4 6]))

a = 2 3 a = 2 3 b = 6 b = 6 4 y = 2 3 4 6

4   Fail
assert(isequal(pfactors(15432),[2 3 4 6 8 12 24 643 1286 1929 2572 3858 5144 7716]))

a = 2 3 643 a = 2 3 643 b = 7716 b = 7716 5144 b = 7716 5144 24 y = 2 3 24 643 5144 7716

Assertion failed.