필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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
Walter Roberson
Walter Roberson 2019년 10월 4일
After you assign to numfiles you should add the lines
assert(numfiles > 0,'no files found')

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by