Watch this Author's files
VERY nice thing, but I had to play with it a lot to make it working!
Change break; to return; on line 95 and it seems to still work fine on recent versions of MATLAB.
it is exellent. i'm thankful for sharing this fanction.