I've learned from this and similar solutions of the use of shiftdim with a negative number. This may well be handy for future programming. Thanks for showing us this feature.
Return the largest number that is adjacent to a zero
3753 Solvers
2982 Solvers
546 Solvers
338 Solvers
365 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!