Given an array (x) of integers, the "counting" array (y) is showing the number of identical consecutive integers in x in front of the integer itself. For example, if
because there is one "1". If then
because there are now two "1"s. Finally, a more complex example:
So y gets two elements for each series of identical integers in x. (I hope this problem does not exist already)
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry PiLearn more
Opportunities for recent engineering grads.Apply Today
New to MATLAB?Learn MATLAB today!
Play games and win prizes!Learn more