Cody

# Problem 44511. Find the repeating elements and repetitions of a row vector.

Solution 2645507

Submitted on 2 Jul 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 = [ 4 4 5 5 5 6 7 7 8 8 8 8 ]; y_correct = [2 3 1 2 4;4 5 6 7 8]; [q,e]=repvec(x); assert(isequal([q;e],y_correct));

Error using repvec Too many output arguments. Error in Test1 (line 3) [q,e]=repvec(x);

2   Fail
x=[2 2 4 5 5 5 6 6 9 9 9]; y_correct = [2 1 3 2 3;2 4 5 6 9]; [q,e]=repvec(x); assert(isequal([q;e],y_correct));

Error using repvec Too many output arguments. Error in Test2 (line 3) [q,e]=repvec(x);

3   Fail
x=[9 9 9 6 6 6 3 3 8 5 5 5 1 1]; y_correct = [3 3 2 1 3 2;9 6 3 8 5 1]; [q,e]=repvec(x); assert(isequal([q;e],y_correct));

Error using repvec Too many output arguments. Error in Test3 (line 3) [q,e]=repvec(x);

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!