MatrixBerryCore
shortcapstr.m
Go to the documentation of this file.
1 function shortName=shortcapstr(longName)
2 isSpaceVec=isspace(longName);
3 longName(isSpaceVec)='_';
4 isTakenVec=isstrprop(longName,'upper');
5 isUscrVec=longName=='_';
6 isDigitVec=isstrprop(longName,'digit');
7 isTakenVec=(isTakenVec|isDigitVec|[false,isDigitVec(1:end-1)]|isUscrVec|...
8  [false,isUscrVec(1:end-1)])&~isSpaceVec;
9 isTakenVec(1)=true;
10 shortName=longName(isTakenVec);
function shortcapstr(in longName)