new 'Spreadsheet data store'. Not working ?

2 ビュー (過去 30 日間)
Simon Parten
Simon Parten 2016 年 3 月 10 日
回答済み: Aaditya Kalsi 2016 年 3 月 10 日
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
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
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.

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by