new 'Spreadsheet data store'. Not working ?
조회 수: 4 (최근 30일)
이전 댓글 표시
We read a lot of spreadsheets. Spreadsheet datastore looked good. Sadly, it doesn't appear to work for me ...
My spreadsheet reads this;
raw = spreadsheetDatastore(filename);
rawData = read(raw);
Unfortunately, that gives me this answer;
Error using matlab.io.datastore.SpreadsheetDatastore/read (line 90)
Unable to convert variable 'PERSPVALUE' in sheet 'descr' in file
'G:\Investment_Management\Transactions\Non_Life_New\Chubb\2016\GlobPropCat\ANALYSIS\PRICING\data\Chubb2016_PROFORMA_1a_INTL.xlsx'
to type 'double'
There is no cell with the value 'PERSPVALUE' in sheet descr. There is a column with that name as the header in sheet 'oeps'. I am unclear on either the purpose or correct usage of the spreadsheetdatastore, and sadly unable to make out what the correct usage would be from the documentation.
I also cannot post the spreadsheet online.
Has anyone had success with this function that they could share? Simon
댓글 수: 1
Walter Roberson
2016년 3월 10일
Some cell in the column named PERSPVALUE could not be converted to double() . For example the column might have text (that does not look like a number). Times can be a problem, depending on which time format they were stored with in the spreadsheet. Charts and graphs would be a problem. I do not know if empty cells would be a problem.
답변 (1개)
Aaditya Kalsi
2016년 3월 10일
I would try setting
raw.NumHeaderLines = 1;
to skip that header row. If there are more, I would tweak that variable.
If all else fails, you could manually specify the Range property as:
raw.Range = 'B2:L1000';
Hope that helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!