readcell does not import last columns when first columns are empty (2019a)

2 ビュー (過去 30 日間)
Martin Jandacka
Martin Jandacka 2019 年 11 月 12 日
回答済み: Urmila Rajpurohith 2019 年 11 月 18 日
readcell('test.xls') does not import last n columns, when first n columns are empty.
i.e. instead of
{missing} {missing} {a} {b} {c} {d}
I will get
{missing} {missing} {a} {b}
When I know the number of columns I have I can use i.e.:
readcell('test.xls', 'Range', 'A:F') - in this case I have the last columns, but the leading empty columns are removed:
{a} {b} {c} {d}
Is there a way to get all the columns (including empty one)?
Edit:
readcell('test.xls', 'Range', '') - helps when one do not know the number of columns, but do not include the missing leading rows.

採用された回答

Urmila Rajpurohith
Urmila Rajpurohith 2019 年 11 月 18 日
If you know the number of columns, then you can use below commands to get all columns including the empty ones.
opts = spreadsheetImportOptions('NumVariables',6,'DataRange', 'A:F');
M = readcell('test.xlsx', opts);

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by