K=10;


fid = fopen('compress_10.txt','wb');
fprintf(fid,'D');
for i=1:K
    fprintf(fid,['\n' num2str(i) '_']);
    load(['ed' num2str(i) '.mat']);
    d=znk;
    for j=1:length(d)
        fprintf(fid,num2str(char(d(j))));
    end
end

fprintf(fid,'\nS');
for i=1:K-1
    fprintf(fid,['\n' num2str(i) '_']);
    load(['es' num2str(i) '.mat']);
    
    for j=1:length(s)
        fprintf(fid,num2str(s(j)));
    end
end
fprintf(fid,'\nend');
fclose(fid);


duz=0;
for i=1:K
    load(['ed' num2str(i) '.mat']);
    d=znk;
    duz=duz+length(d)*2;
end

for i=1:K-1
    load(['es' num2str(i) '.mat']);
    duz=duz+length(s);
end
duz