MATLAB: Conveter a string with space in a number

convertdata importstring

A have one vector returned by the function textscan which have spaces inside the numerical string.
E.g.:
' 0 0 , 2 3 '
' 1 2 , 1 5 '
First, a have to substitute the ',' by '.' (it's simple) but how I remove the spaces? Because using str2num in this vector is returned error.

Best Answer

It's pretty much the same except that you set it equal to [] instead of a decimal point:
str(str == ' ') = []; % Remove spaces