Original commit. Grabbed from http://www.mathworks.com/matlabcentral/fileexchange/44203-produce-list-of-all-cases-in-the-current--switch--block/content/getCases.m