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
-
Remove any row in which a NaN appears
8763 Solvers
-
Project Euler: Problem 9, Pythagorean numbers
1383 Solvers
-
Duplicate each element of a vector.
634 Solvers
-
Implement a bubble sort technique and output the number of swaps required
380 Solvers
-
97 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!