MATLAB: Error when using clearvars

clearvarserroryosemite

After updating my mac to Yosemite, everytime I call the function clearvars (e.g.
clearvars x y;
or:
clearvars -except z
)I have the following error:
Error using strjoin (line 14) Expected input to be one of these types:
char
Instead its type was cell.
Error in clearvars>createPattern (line 188) pattern = sprintf('(%s)$', strjoin(variableArgs, '|'));
Error in clearvars (line 70) clearVarPat = createPattern(clearVarArgs, flags.regexpClear);
Any help to solve this issue?

Best Answer

Alberto ran the command
which strjoin -all
and noticed that he had a "creepy" strjoin.m file in the path.