for i=1:app.le
k=i; app.EditField.Value=fprintf('%d',k)
text=fileread(app.str(i));
text2=strrep(text,',','.');
dlmwrite(app.str(i),text2,'delimiter','');
fidi = fopen(app.str(i),'rt')
k1 = 1;
while ~feof(fidi)
readline = fgetl(fidi);
if strcmp(readline,'Results:')
C = textscan(fidi, '%f%f%f%f %*f%*f%*f%*f%*f%*f', 'HeaderLines',9, 'CollectOutput',1);
else
C = textscan(fidi, '%f%f%f%f %*f%*f%*f%*f%*f%*f', 'HeaderLines',9, 'CollectOutput',1);
end
M = cell2mat(C);
fprintf(1,'\tSection %2d: (%4d x %d)\n', k1, size(M))
if isempty(M)
fprintf(1,'Reading finished, %d Sections\n',k1-1)
break
end
D{k1,:} = M;
fseek(fidi, 0, 0);
k1 = k1 + 1;
end
fclose(fidi);
Dflip = flip(D);
app.Out = cell2mat(Dflip);
un=app.Out(:,1);
t=app.Out(:,2);
T=app.Out(:,3);
Cp=app.Out(:,4);
a=find(un==0);
b=find(un==1);
if length(a)~=length(b)
unit=b;
else unit=a;
end
extr= [diff(a);length(un)-a(end)+1];
In = mat2cell(t, extr);
for j=2:length(In)
A=In{j-1,end}; AA=A(end);
In{j,:}=In{j,:}+AA;
end
time=cell2mat(In);
app.Matr=[un t T Cp time];
app.C=strcat(app.path, 'conv_', app.A(1+i));
writematrix(app.Matr,app.C,'Delimiter','tab'); app.GotonextstepLamp.Color='g';
end