Borrar filtros
Borrar filtros

Reading of Excel files in MATLAB_R2016 vs MATLAB_R2018

2 visualizaciones (últimos 30 días)
Thishan Dharshana Karandana Gamalathge
Comentada: Walter Roberson el 21 de Jun. de 2018
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 comentario
Walter Roberson
Walter Roberson el 21 de Jun. de 2018
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);

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by