MATLAB: Xlsread converting TRUE to 1

xlsread

Does anyone have a work around for when xlsread reads in the raw data and converts the string TRUE into a 1???
It appears that it is doing automatic conversion to boolean, when I need to keep it as a string/char value. This doesn't happen when there are other characters in the field. I'm storing the data into cell arrays, but cannot seem to preserve a string of TRUE from an Excel spreadsheet.
Thanks,
-Mike

Best Answer

What I found so far:
  • typing in excel true converts the value to 1 (boolean true) if any numeric or general format is selected
  • typing in excel true when the format was preselected to text, keeps the string (thus importing with xlsread keeps the string)
  • having typed true with numeric or general format and then converting to text format does not affect the saved value unless you press F2 then Enter. Unfortunately this last operation is aplpicable to single cells.
The solution:
  1. in Excel, select the whole column with the boolean TRUE or FALSE
  2. under the tab panel Data > Text To Columns > Next > Next
  3. select Text (Column data format) > Finish
  4. use [a,b,raw] = xlsread(...)