I'm hoping there is a built-in function I don't know about that solves this problem. Perhaps accumarray?
Determine whether a vector is monotonically increasing
12545 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
817 Solvers
Make a run-length companion vector
524 Solvers
Calculate the Hamming distance between two strings
180 Solvers
Test if two numbers have the same digits
190 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!