필터 지우기
필터 지우기

Reading of Excel files in MATLAB_R2016 vs MATLAB_R2018

조회 수: 2 (최근 30일)
Thishan Dharshana Karandana Gamalathge
댓글: Walter Roberson 2018년 6월 21일
When i am trying to extract data using the command [num_1,txt_1]= xlsread('test','Sheet1'), R2016 version considers the 1st row (which is column headers) too, despite it shows NaN. At the same time R2018 version correctly extract numbers starting the seconds row. So I cannot use the same program to extract data in two MATLAB versions. What is the reason?
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 6월 21일
Could you attach the .xls, just in case there is something odd about it?
The num output of xlsread() was always intended to omit all leading and trailing rows and columns that have no entries that can be interpreted as numbers. Like
nn = isnan(converted_data);
nnr = ~all(nn, 2);
sr = find(nnr, 1, 'first');
er = find(nnr, 1, 'last');
nnc = ~all(nn, 1);
sc = find(nnc, 1, 'first');
ec = find(nnc, 1, 'last');
num = converted_data(sr:er, sc:ec);

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

답변 (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