Cody

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

So let's say that x is a vector, for example, x = [4, 4, 5, 5, 5, 6, 7, 7,8, 8, 8, 8]

Now we want to get the following two vectors, l = [2, 3, 1, 2, 4]; The number of repeats per element of x.

v = [4, 5, 6, 7, 8]; The value of repeating elements in x.

Solution Stats

64.0% Correct | 36.0% Incorrect
Last solution submitted on Mar 04, 2019

Problem Comments