How to select all values of a cell array between two cells?

조회 수: 1 (최근 30일)
Ibro Tutic
Ibro Tutic 2016년 4월 21일
댓글: Ibro Tutic 2016년 4월 21일
I was previously using 3 xlsread functions, and I realized this probably wasn't the best way to go about it. I was reading some data from tables, so using xlsread, I was able to specify what cells I want read (in this case, B2:P14). How would I do something similar in matlab (because table/array size may vary, how would I just go about getting all data located after (2,2), instead of from (2,2) to (14,16), for example)?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 21일
V=xlsread('file.xlsx')
out=V(2:end,2:end)
  댓글 수: 3
Guillaume
Guillaume 2016년 4월 21일
There is no guarantee whatsoever that V(2, 2) corresponds to cell B2 of the excel file. Since xlsread trims empty rows and columns V(2, 2) may be C3 or even AZ1500.
Ibro Tutic
Ibro Tutic 2016년 4월 21일
Yea I know, the excel spreadsheets are formatted ahead of time by people using the code, so that shouldn't be an issue. Thanks for the heads up.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by