2 ILLEGAL_CHARACTER_LIST = {
'/',
'\n',
'\r',
'\t',
'\f',
'`',
'?',
'*',
'\\',
'<',
'>',
'|',
'\"',
':' };
3 illegalCharList=cellfun(@sprintf,ILLEGAL_CHARACTER_LIST,
'UniformOutput',
false);
4 isBadCVec=cellfun(@(x)(inpStr==x),illegalCharList,
'UniformOutput',
false);
5 isBadMat=vertcat(isBadCVec{:});
6 isBadVec=any(isBadMat,1);
8 fileName(isBadVec)=
'_';
function genfilename(in inpStr)
GENFILENAME generates a valid file name based on a given string.