xlsread function and ranges

data1 = xlsread('data1.xlsx', 'sheet1', 'A1:B48')
my spreadsheet has data for each day of a month (day 1 to day 30) day 1 equals the range A1:B48, day 2 would be A49:B96 etc so the nth term would be 48n - 47 for A and 48n for B where n = day of the month. how can i incorporate the nth term into the xlsread function so that anyone can choose any value of n between 1 and 30 (here i can also use the opportunity to use if statement) and it'll generate the xls read function for that given day? can i even put a formula in for the range in xlsread function?

답변 (1개)

Walter Roberson
Walter Roberson 2019년 4월 20일

1 개 추천

"A"+((n-1)*48+1)+":B"+(n*48)

카테고리

제품

태그

질문:

2019년 4월 20일

답변:

2019년 4월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by