Use variables for DataRange option in detectImportOptions

8 次查看(过去 30 天)
So,
I'm reading an xlsx file with
covidData = detectImportOptions('COVID19.xlsx');
now, I would like to use
covidData.DataRange = 'firstIndex:lastIndex';
to access the data I need. Problem is that my range is saved into variables and, I don't think that .DataRange took actual variable as a range but it works only if I use actual number as
covidData.DataRange = '1:2';
Is there a way to bypass it?

采纳的回答

Nicola Caldognetto
Just found out the solution.
Easy way is to concatenate strings with
strcat(firstIndex_s,':',lastIndex_s);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by