Is there anyway i can write this code efficiently and reduce runtime? I am trying to import data from multiple files in a folder
clc;clear;
testfiledir = 'C:\Users\bidgu\OneDrive\Desktop\manpower';matfiles = dir(fullfile(testfiledir, '*.xlsm'));nfiles = length(matfiles);datafi = cell(nfiles);for i = 1 :nfiles% fid = fopen( fullfile(testfiledir, matfiles(i).name) );
datafi{i} = readtable(fullfile(testfiledir, matfiles(i).name));% fclose(fid);
end
Best Answer