importdata function yields empty data structure

조회 수: 12 (최근 30일)
Milou
Milou 2012년 7월 3일
Hello,
I have been importing .xls and .xlsx data into matlab with calls similar to the following:
rawdata = importdata('/Users/username/Desktop/fromfile.xlsx');
it has worked in the past, but now MATLAB creates empty data structures.
i can open the .xlsx file in openoffice to see that the file is not empty, as well as in SPSS from which it was originally saved from a .sav to .xlsx.
any ideas as to why this function does not retrieve my data?
Thanks in advance for all your help.
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 7월 3일
Does the file have text in the each row? .xlsx and .xls files are read by calling xlsread() , and
The array does not contain any information from header lines, or from outer rows or columns that contain nonnumeric data. xlsread converts text in inner rows and columns to NaN.

댓글을 달려면 로그인하십시오.

채택된 답변

per isakson
per isakson 2012년 7월 3일
Try
file_spec = '/Users/username/Desktop/fromfile.xlsx';
exist( file_spec, 'file' )
[ num, txt, raw ] = xlsread( file_spec );

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by