Invalid or Empty Spreadsheet error ?
이전 댓글 표시
Greetings everyone,
I am beginner in Matlab and currently using Matlab R2013a.
I need to import a excel file into Matlab. So, I use the Import Data button and select the file I want to import. But in Matlab, a message appears that "the spreadsheet is invalid or empty" !!! And there is surely data present in the spreadsheet. I really don't know how to resolve this. Need help ASAP !!!
Regards, Abhik Das
댓글 수: 3
Image Analyst
2014년 9월 19일
Can you attach your workbook so we can try it ourselves?
Abhik Das
2014년 9월 20일
Image Analyst
2014년 9월 23일
That's not an Excel workbook, it's a simple text file. How did you try to read it in? With xlsread()? Or some other function?
답변 (1개)
Star Strider
2014년 9월 20일
Use testscan. It will read it without problems:
fidi = fopen('S17_R1.xls');
D = textscan(fidi, '%f %f', 'HeaderLines',2);
produces ‘D’ as a (1x2) cell:
D =
[502x1 double] [502x1 double]
댓글 수: 5
Abhik Das
2014년 9월 22일
Star Strider
2014년 9월 22일
What error do you get?
It worked for me with your file and with the code I posted.
Abhik Das
2014년 9월 23일
Guillaume
2014년 9월 23일
Most likely, fidi equal -1, meaning the file was not found. Check the filename, and that the file is in the current matlab folder.
Star Strider
2014년 9월 23일
Be sure the file is either in your MATLAB user folder (or somewhere in the MATLAB search path), or that you provide the full path to the file.
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!