我有一个循环,可以从文件夹中的几个 excel 文件中读取表格。但是我收到以下错误:
Unable to open file 'C:\MATLAB\Data\fish\~$volume022017.xlsx' as a workbook. Check that the file exists, read access is available, and the file is a valid spreadsheet file.
我怀疑这是一个临时文件(我无法在资源管理器中看到)。文件列表是使用 'dir' 创建的:
filesData = [dir([folder,'\*.xlsx']);dir([folder,'\*.xls'])];
filenames = {filesData.name}';
'filenames' 也没有列出这个文件。
然后我用
tmpTable=readtable( [folder, filenames{i}],'sheet',Tabs{term},'ReadRowNames',true);
这给出了错误。