Problem 51740. Find all the indices when a value repetition occurs
Solution Stats
Problem Comments
-
4 Comments
It would be nice making this working with nan and adding the repeated values as second output
Could I convince you to use isempty() for the last test, rather than isequal(..., [])? Since -- for n>0 runs in the input array -- the output is n-by-2, it is quite natural for the output to be 0-by-2 when there are no runs, but a 0-by-2 empty array is not equal to [].
The last test case has been changed to use isempty() instead of isequal().
Thanks, Dyuman!
Solution Comments
Show commentsProblem Recent Solvers11
Suggested Problems
-
Select every other element of a vector
35895 Solvers
-
2461 Solvers
-
Test if a Number is a Palindrome without using any String Operations
251 Solvers
-
Back to basics 20 - singleton dimensions
275 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13501 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!