Importing data is something that can be very challenging but need not be, especially if you are the one who created the file containing the data. To the extent possible, it's best to keep things simple (ya, even when importing data!). Have clear/obvious labels for each variable with a separate column for each.
Reading and Writing to Excel / CSV Files
The command is:
>> [numData, strData] = xlsread('myExcelFile.xls');
The numeric data is stored in numData and the string/text in strData. The number of columns in strData is bounded below by the number of variables in the sheet. The default sheet is the first sheet.
To upload data from a particular sheet, use:
>> [numData, strData] = xlsread('myExcelFile.xls', sheet);
To upload data from a particular range:
>> [numData, strData] = xlsread('myExcelFile.xls', sheet, range);
Both Excel and MATLAB represent numeric dates as a number of serial days elapsed from a specific reference date. However, Excel uses January 1, 1900 as the reference date while MATLAB uses January 0, 0000. Due t this difference in the way Excel and MATLAB compute numeric date values, any numeric date imported from Excel into MATLAB must first be converted before being used in the MATLAB application.
You can do this conversion after the xlsread completes, as:
>> excelDates = xlsread('filename')
>> matlabDates = datenum('30-Dec-1899') + excelDates
>> datestr(matlabDates, 2)
To write a matrix M to an Excel file, use the syntax:
>> xlswrite(filename, sheet, range)
If one has only data (no labels) in an Excel file, the faster way is to work with the CSV (comma separated value) format. It is faster than xlsread. The syntax is similar. Use help csvread.
Reading and Writing to Text Files
The main command is textread.
More [TBA]
Using the Import Wizard
Use the command uiimport to launch the Import Wizard. I learn that with MATLAB v.7 onwards import wizard has become very powerful and user-friendly. Though I haven't used it, its user-interface should be very much like Excel and should be relatively easy to figure out. I, however, prefer the use of commands to read files. It makes for lesser errors and is generally much faster that way. In any case, most of the coding when working with data is best carried out using M-files and there the import wizard isn't much use. For most practical purposes commands textread and xlsread are good enough. That said, I admit, for prototyping and doing ad-hoc analysis, using import wizard can save time.
Btw, a long time ago I was comparing the performance of v.7.01 and v.6.5 and found xlsread to be way slower in v.7 as compared to v.6.5. Have you noticed that too? Just curious.
Low Level File I/O
Other than using the above discussed utilities for accessing files, one can also use MATLAB's low level file I/O functions/handles (as in, for example, C/C++). For most of my work I have been able to get by without using these, but they must be mentioned - if only for the sake of completion. Here is the link. For those new to programming, I suggest you first practice with the (above) more high level functions before getting to play around with these (resulting in shorter and, generally, faster codes).