Development Environment | ![]() ![]() |
Importing Text Data
The easiest way to import text data into the workspace is to use the MATLAB Import Wizard. You simply start the Import Wizard and specify the file that contains the data you want to import. The Import Wizard can process most numeric data files automatically, even if they contain text headers. See Using the Import Wizard with Text Data below for more detailed information.
If you need to work from the MATLAB command line or perform import operations as part of an M-file, you must use one of the MATLAB import functions. Your choice of which function to use depends on the type of data in the file and how the data is formatted. MATLAB has functions that work with numeric data and other functions that can handle both alphabetic and numeric data. See Using Import Functions with Text Data for more information about choosing the function that is right for your data.
Caution When you import data into the MATLAB workspace, you overwrite any existing variable in the workspace with the same name. |
![]() | Importing and Exporting Data | Using the Import Wizard with Text Data | ![]() |