フィルターのクリア

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

1 回表示 (過去 30 日間)
Jonathan Bijman
Jonathan Bijman 2019 年 10 月 4 日
コメント済み: Jonathan Bijman 2019 年 10 月 5 日
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')
Jonathan Bijman
Jonathan Bijman 2019 年 10 月 5 日
Thanks Walter =)

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by