The second method is to convert characters into numbers and use the function str2num.
Use of xlsread
Example:
1. Default operation:
NUMERIC = xls read(FILE);
[NUMERIC,TXT]= xls read(FILE);
[NUMERIC,TXT,RAW]= xls read(FILE);
2. Get data from the default area:
NUMERIC = xls read(' c:\ MATLAB \ work \ myspreadsheet ')
3. Get data from the used area in the worksheet other than the first worksheet:
NUMERIC = xls read(' c:\ MATLAB \ work \ myspreadsheet ',' sheet2 ')
4. Get data from the named worksheet:
NUMERIC = xls read(' c:\ MATLAB \ work \ myspreadsheet ',' NBData ')
5. Get data from the specified area in the worksheet except the first area.
Worksheet:
NUMERIC = xls read(' c:\ MATLAB \ work \ myspreadsheet ',' sheet2 ',' a2:j5 ')
6. Get data from the specified area in the named worksheet:
NUMERIC = xls read(' c:\ MATLAB \ work \ myspreadsheet ',' NBData ',' a2:j5 ')
7. Get data from the worksheet area specified by the index:
NUMERIC = xls read(' c:\ MATLAB \ work \ myspreadsheet ',2,' a2:j5 ')
8. Interactive region selection:
NUMERIC = xls read(' c:\ MATLAB \ work \ myspreadsheet ',- 1);
You must select an activity area and active sheet.
EXCEL window that will be the focus. Click OK in the data.
When you have finished selecting the active area, select the dialog box.