f = dir('*.mat');

for i = 1:length(f)
    clear time channel waveform threshold
    load(f(i).name);
    save(f(i).name,'time','waveform','channel','-v6');
end