Hello everyone,
i have a for loop reading several files and doing some calculations for each of them. What i want to do is to save the results from every file in a seperate sheet on one excel file.
%% reading the files
files = dir('*.txt');N=length(files); for i=1:N filename=files(i).name; fid=fopen(filename); data = textscan (fid, '%s %s %s %s %s %s %s %*s %*s %s %*s', 'headerLines', 2); %%saving
R1=table (Time, beta, Sh, K, 'VariableNames' , {'Time', 'beta', 'Sh', 'K'}); F_xlsx=sprintf('results.xlsx'); writetable(R1,F_xlsx,'Sheet',[files(i).name]);
this is how i tried, but the it is filling the sheet only with the first file.
Best Answer