| [ KAIST ] in KIDS 글 쓴 이(By): g9611090 (뚜리맨) 날 짜 (Date): 2002년 12월 18일 수요일 오전 10시 12분 21초 제 목(Title): Re: [q] 엑셀파일을 매트랩 파일로? help xlsread XLSREAD read Excel spreadsheet (XLS) file. A = XLSREAD('FILENAME') returns numeric data from first sheet in Excel file FILENAME. [A, B] = XLSREAD('FILENAME') numeric data is stored in A, text data is stored in B. [...] = XLSREAD('FILENAME','SHEETNAME') same as above but uses sheet named SHEETNAME. It is an error if SHEETNAME does not exist. Empty cells or cells with text create NaNs in the numeric result. Leading rows and columns of text do not create NaNs in the numeric result. This makes it easier to load files that look like this: Time Temp 12 98 13 99 14 97 City Time Temp Dallas 12 98 Tulsa 13 99 Boise 14 97 To get available sheet names from file, call XLSFINO with two outputs. For example: [status, sheetNames] = xlsfinfo(FILENAME) When reading date fields from Excel files, the date numbers need conversion to a MATLAB date. For example, if your Excel file contains: 4/12/99 4/13/99 4/14/99 Convert the data to MATLAB dates like this: excelDates = xlsread(FILENAME) matlabDates = datenum('30-Dec-1899') + excelDates See also LOAD, FILEFORMATS, XLSFINFO, DATENUM, DATEVEC |