Advertisement

MATLAB编程实例(32):最长连续数Longest run of consecutive numbers

阅读量:

题目

来源于Mathwork上的Cody,Problem 672 - Longest run of consecutive numbers.

Given the vector a, determine which number(s), if any, appear consecutively most frequently. As an illustration, consider when a = [1, 2, 2, 2, 1, 3, 2, 1, 4, 5, 1]. In this case, the result would typically be the number 2, since it occurs three times in succession. If the input a is structured as a row vector (row vector), then so will the output (output) be formatted as such. Conversely, if a is provided as a column vector (column vector), then the output will correspondingly be struc

全部评论 (0)

还没有任何评论哟~