How can I read in data from Excel where I have the row range stored as a variable

2 ビュー (過去 30 日間)
Luke Marsden
Luke Marsden 2017 年 1 月 31 日
編集済み: Jan 2017 年 1 月 31 日
I am reading data from an excel sheet, and can read my data perfectly fine when I define the row range as a number, such as:
LPHYB = xlsread('Tungurahua_Activity_Log_temp.xlsx', ...
'Hourly_Seismic_Record', 'G699:G1004');
However, I would like to be able to store my first row and last row as a variable, like this:
LPHYB = xlsread('Tungurahua_Activity_Log_temp.xlsx', ...
'Hourly_Seismic_Record', 'Gstartrow:Gendrow');
This is not working. The error message reads:
'Maximum variable size allowed by the program is exceeded.'

採用された回答

Jan
Jan 2017 年 1 月 31 日
編集済み: Jan 2017 年 1 月 31 日
Matlab's error message is not clear. You can define the string as following:
LPHYB = xlsread('Tungurahua_Activity_Log_temp.xlsx', ...
'Hourly_Seismic_Record', sprintf('G%d:G%d', startrow, endrow));

その他の回答 (0 件)

カテゴリ

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