Matlab readtable(): read numeric spreadsheet data as text

Matlab’s readtable() function cannot be manually told the spreadsheet column data format. The 'Format' '%s %f' option ONLY applies to text files.

Fix your spreadsheet (.xls, .ods) where an all-numeric column is being read as text in cells:

  1. highlight that entire column
  2. select Format Cells, Number.

Microsoft Excel has that handy green alert triangle if you do this (store a number as text).

Note: it is permissible to have the first row of an all-numeric column be a text header.

Leave a Comment