%(c) Eamonn Keogh and Abdullah Mueen

function tiny2ts(strt,num,ps)
 
ts(1:ps,1:768) = 0;
 
for i=strt:num
  
    if( mod(i,ps)== 0 )
 
        img = read_tiny_big_binary(i);
        I = reshape(img,32,32,3);
        ts(ps,:) = im2ts(I);
 
        fname = sprintf('L:\\tinyTS\\i%d.txt',i/ps);
        save(fname,'ts','-ascii');
        i
    else
        img = read_tiny_big_binary(i);
        I = reshape(img,32,32,3);
        ts(mod(i,ps),:) = im2ts(I);
 
    end
 
end
 
fname = 'L:\\tinyTS\\ilast.txt';
save(fname,'ts','-ascii');
 
end
