Import Text Data intoMATLAB
Use the following functions to import text data into MATLAB®. Usually, the easiest way to import text data into MATLAB is to use theextractFileText
function. For example, to import text from a text file, use:
str = extractFileText('sonnets.txt');
Source | Function | Example |
---|---|---|
Text,Microsoft®词, PDF, and HTML files | extractFileText |
str = extractFileText('sonnets.txt'); |
CSV andMicrosoft Excel®files | readtable |
tbl = readtable('weatherReports.csv','TextType','string'); |
HTML code | extractHTMLText |
str = extractHTMLText(' |
PDF forms | readPDFFormData |
data = readPDFFormData('weatherReportForm1.pdf'); |
See Also
extractFileText
|readtable
|extractHTMLText
|readPDFFormData