I want to read multiple non-adjacent columns from an excel spreadsheet

조회 수: 1 (최근 30일)
Jacob
Jacob 2017년 3월 9일
답변: Rik 2017년 3월 9일
Hi there,
I would like to read in four non-adjacent columns from an excel spreadsheet, how do I do this? Example shows I want parts of columns C,H,M and R...
"X = xlsread('mydata.xlsx','C3:C127,H3:H127,M3:M127,R3:R127') ;"
Thanks a lot!

답변 (1개)

Rik
Rik 2017년 3월 9일
I would read the entire file and select the data in Matlab afterwards. You need the Excel syntax in the string. I don't think it is possible in the way you want to do this.
X = xlsread('mydata.xlsx');
X=X(3:127,'CHMR'-64);%this trick relies on the conversion from ASCII to an index value

카테고리

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