title: Why can't the matlab textscan function read + 22.24 as a float?
body: <p>I'm currently having a problem with the matlab function textscan.
  I got a data file which looks like this:</p>
  
  <pre><code>     1,2018/08/14 17:06:15,  0,+ 22.24,+ 22.46,+ 18.18,+0.0000,+0.0005,LLLLLLLLLL,LLLLLLLLLL,LLLL
  </code></pre>
  
  <p>or sometimes when a sensor isn't working properly it looks like this:</p>
  
  <pre><code>   1,2018/07/11 17:02:53,  0,+ 23.88,+ 24.78,+ 23.65,+++++++,+ 23.94,+ 23.01,+ 24.33,LLLLLLLLLL,LLLLLLLLLL,LLLL
  </code></pre>
  
  <p>Since the data varies from file to file I am creating a matching formatSpec from the headerline. 
  In the 1st case it would look like</p>
  
  <pre><code>formatSpec = '%*u %s %*u%f%f%f%f%f%*[^\n]'
  </code></pre>
  
  <p>and in the 2nd case like</p>
  
  <pre><code>formatSpec = '%*u %s %*u%f%f%f%f%f%f%f%*[^\n]'
  </code></pre>
  
  <p>I am using the texscan function like this:</p>
  
  <pre><code>textscan(fileID, formatSpec_data, data_rows, 'Delimiter', ',', 'TreatAsEmpty', {'+++++++'},'EmptyValue', NaN, 'ReturnOnError', 0 );
  </code></pre>
  
  <p>but it keeps throwing an error on me with the message</p>
  
  <pre><code>Error using textscan
  Mismatch between file and format character vector.
  Trouble reading 'Numeric' field from file (row number 1, field number 4) ==&gt; + 23.88,+ 24.78,+ 23.65,+++++++,+ 23.94,+ 23.01,+ 24.33,LLLLLLLLLL,LLLLLLLLLL,LLLL\n
  
  Error in data_logger (line 31)
  dataArray = textscan(fileID, formatSpec_data, data_rows, 'Delimiter', delimiter, 'HeaderLines' ,startRow, 'TreatAsEmpty', {'+++++++'},'EmptyValue', NaN, 'ReturnOnError', 0 );
  </code></pre>
  
  <p>When I deactivate 'returnOnError' then textscan reads only the first row and except the date/time string everything is just empty. I also tried to use textscan without TreatAsEmpty and / or EmptyValue but I get the same result.
  I really don't get why textscan got problems to read e.g. ,+ 22.24 as a float.
  When I specify formatSpec to read all the data as strings it works but then I have to use str2num afterwards which I don't really want to do.</p>
  
  <p>I'm thankful for every help and looking forward to understand this behaviour.</p>