why does appear the error message: Error in table2cell t_vars = getVars(t,false);?

Dear community
I have a program to load several excel files:
datadir = 'C:\Users\Jonat\Desktop\limpio';
dinfo = dir( fullfile(datadir, '*.xlsx') );
filenames = fullfile( datadir, {dinfo.name} );
numfiles = length(filenames);
datatable = [];
for K = 1 : numfiles
thisfile = filenames{K};
thistable = readtable(thisfile);
if K == 1
datatable = thistable;
else
datatable = [datatable; thistable];
end
end
Clean=table2cell(datatable);
nrow = height(datatable);
lastidx = floor(nrow/9) * 9;
E_p = mean(reshape(datatable{1:lastidx,17}, 9, []));
E_C=E_p.';
When I first used this program, I didn´t have any problem, but now, appear this error:
Error in table2cell (line 21)
t_vars = getVars(t,false);
Please help!
Thank you so much

4 comentarios

There are no .xlsx files in C:\Users\Jonat\Desktop\limpio\ so datatable is []
Thanks walter, but What thing should I write in this command in order to read the excel files? I don’t know Please help Thank u
After you assign to numfiles you should add the lines
assert(numfiles > 0,'no files found')

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Etiquetas

Preguntada:

el 4 de Oct. de 2019

Comentada:

el 5 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by