{
  "name": "MATLAB functions for importing CSV files: return type, suitable data and status",
  "description": "Compares the MATLAB text-import functions that can read CSV files, by what they return, the kind of data each is intended for, and their documented status. Compiled from the MathWorks MATLAB documentation pages for each function and the guide to importing text files.",
  "page": "https://casrai.org/guides/read-csv-in-matlab",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T22:02:01Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Function",
      "unit": "",
      "description": ""
    },
    {
      "name": "Returns",
      "unit": "",
      "description": ""
    },
    {
      "name": "Intended for",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented status",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Function": "readtable",
      "Returns": "table",
      "Intended for": "Mixed-type tabular data; reads .txt, .dat, .csv as delimited text and also spreadsheets",
      "Documented status": "Listed in the import guide"
    },
    {
      "Function": "readmatrix",
      "Returns": "numeric array (default)",
      "Intended for": "Uniform data, all of the same type",
      "Documented status": "Listed in the import guide; the documented replacement for csvread"
    },
    {
      "Function": "readcell",
      "Returns": "cell array",
      "Intended for": "Non-uniform data, each column a different type",
      "Documented status": "Listed in the import guide"
    },
    {
      "Function": "readtimetable",
      "Returns": "timetable",
      "Intended for": "Data where each row has a timestamp",
      "Documented status": "Listed in the import guide"
    },
    {
      "Function": "readlines",
      "Returns": "string array",
      "Intended for": "Plain text lines",
      "Documented status": "Listed in the import guide"
    },
    {
      "Function": "textscan",
      "Returns": "cell array of columns",
      "Intended for": "Low-level control; described as not necessary for most workflows",
      "Documented status": "Listed in the import guide"
    },
    {
      "Function": "csvread",
      "Returns": "numeric matrix",
      "Intended for": "File must contain only numeric values",
      "Documented status": "Not recommended since R2019a; no plans to remove"
    }
  ],
  "sources": [
    {
      "title": "MathWorks: Ways to import text files",
      "url": "https://www.mathworks.com/help/matlab/import_export/ways-to-import-text-files.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "MathWorks: readtable",
      "url": "https://www.mathworks.com/help/matlab/ref/readtable.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "MathWorks: readmatrix",
      "url": "https://www.mathworks.com/help/matlab/ref/readmatrix.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "MathWorks: readcell",
      "url": "https://www.mathworks.com/help/matlab/ref/readcell.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "MathWorks: csvread",
      "url": "https://www.mathworks.com/help/matlab/ref/csvread.html",
      "accessed": "2026-11-12"
    }
  ]
}