str2num(chr) converts a character array or string scalar to a numeric matrix. The input can include spaces, commas, and semicolons to indicate separate elements. If str2num cannot parse the input as numeric values, then it returns an empty matrix.
The str2num function does not convert cell arrays or nonscalar string arrays, and is sensitive to spacing around + and - operators.
str2num() contains a call to eval(), which means that if your string has the same form as an array (e.g. with semicolons) then it is simply executed and the resulting array is returned. The problems with str2num() are that it doesn’t support cell arrays, and that because it uses an eval() function, wierd things can happen if your string includes a function call. str2double() is supposedly faster as well. So the general rule seems to be, use str2double() unless you are wanting to convert a string array of numbers to a numerical array.
There is one catch though- if you are converting a single number from a string to a number, then it would SEEM like str2num() and str2double() are interchangable, drop in replacements. However, if the string is not a number, they behave differently