%load the waveforms
load SpikeSorting.mat
session(1).wf=double(session(1).wf);
wf = session(1).wf;

%find the principal components
[coeff, score] = princomp(wf);

edges{1} = [-300:25:300];
edges{2} = [-250:25:250];

h = hist3(score(:,1:2),edges);

s = surface(h');
set(s,'XData',edges{1})
set(s,'YData',edges{2})