Read NaN data from excel file

41 visualizaciones (últimos 30 días)
Anna Stasinopoulou
Anna Stasinopoulou el 5 de Jun. de 2021
Comentada: Sulaymon Eshkabilov el 9 de Jun. de 2021
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?

Respuesta aceptada

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 5 de Jun. de 2021
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 comentarios
Anna Stasinopoulou
Anna Stasinopoulou el 9 de Jun. de 2021
Thank you very much
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 9 de Jun. de 2021
Most welcome!

Iniciar sesión para comentar.

Más respuestas (1)

SALAH ALRABEEI
SALAH ALRABEEI el 5 de Jun. de 2021
click on import and choose the xls file

Community Treasure Hunt

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

Start Hunting!

Translated by