
fname = '/mnt/NyuShare/Buzsakilabspace/Datasets/EnglishD/Mouse1_AxAx1_Axoaxonic/mouse1_180415/mouse1_180415.spk.1';
waveforms = LoadSpikeWaveforms(fname,32,48);

if nargin < 3,
  error('Incorrect number of parameters (type ''help LoadSpikeWaveforms'' for details).');
end
waveforms = LoadBinary(filename);
waveforms = reshape(waveforms,nChannels,nSamples,[]);

[xml, rxml] = LoadXml('mouse1_180415.xml');
ch = xml.AnatGrps.Channels+1;
clu = LoadClu('mouse1_180415.clu.1');

     
                %channels x samples x spikes
                
waveforms = waveforms(ch,:,:);

  fid2=fopen(fname,'w');
                
          
                fwrite(fid2,waveforms(:),'int16');