new 'Spreadsheet data store'. Not working ?
2 次查看(过去 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!