>> txt = '5 7; 8 9';>> f = str2num(txt)f = 5 7 8 9>> f = str2double(txt)f = NaN
So I have a text of that form with semi-colon and spaces and the str2num() is doing a very good job in getting me a 2×2 matrix, which is what I need and it has saved me a lot of hassle.
But the software recommended to use str2double() as it has got high precission or something like that. So, my doubt is-
1) Why isn't it working like str2num() here?
2) What is the actual difference between them ?
3) Should I stick with str2num() in this case?
Best Answer