refer to excel data using excel column numbers ?
이전 댓글 표시
I read in a large excel data file using readmatrix :
data = readmatrix('press.xlsx');
I would like to refer to the data by the original column names in excel - for example, for the third column, something like :
x = data(:,'C')
This runs but produces wrong results - Any way to make this work ? Thanks
답변 (1개)
Voss
2023년 7월 14일
0 개 추천
Use readtable instead of readmatrix.
댓글 수: 3
Voss
2023년 8월 15일
@Ambady Suresh: Did this answer work for you?
Ambady Suresh
2023년 8월 16일
When data is a table, you would say:
x = data{:,'C'}
or:
x = data.C
Please see:
https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!