필터 지우기
필터 지우기

Read NaN data from excel file

조회 수: 37 (최근 30일)
Anna Stasinopoulou
Anna Stasinopoulou 2021년 6월 5일
댓글: Sulaymon Eshkabilov 2021년 6월 9일
Hello, I want to read an excel file with 2 columns and many rows and I need to read all the data, from row 1 to the last one. The problem is that the first rows are empty excel cells and when using xlsread, matlab ignores them and starts reading from the first not NaN data. Is there anything I can do to fix that?

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 5일
If you are using xlsread(), then specify the cell range, e,g: DATA = xlsread('MY_data.xlsx', 'Sheet1', 'A1:D123');
Then you can convert all emppty cells into nan's by using logical indexing using missing data.
  댓글 수: 2
Anna Stasinopoulou
Anna Stasinopoulou 2021년 6월 9일
Thank you very much
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 9일
Most welcome!

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

추가 답변 (1개)

SALAH ALRABEEI
SALAH ALRABEEI 2021년 6월 5일
click on import and choose the xls file

카테고리

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