% : vim: set filetype=matlab :
function [Wnew]=reformWeights( W )

Wnew = [];

WSize = size(W);

% if W looks like this:           13          72        9216
% convert to this:                 9           8        9216          13

% if W looks like this:           663552           7
%wB=reshape(wB,9,8,9216,7);

maxAU = WSize(1);

for AU=1:maxAU
    index=0;
    for ni=1:9
        for mu=1:8
            index=index+1;
            slice=squeeze( W(AU,index,:) );
            Wnew(ni,mu,:,AU)=slice;
        end
    end
end
