This MATLAB function constructs a string varname that is similar to or the same as the str input, and can be used as a valid variable name.
www.mathworks.com