% : vim: set filetype=matlab :
function makeSVMWeights( SVMFile, is_silent, prefix, certVersion )

eval( ['load ', SVMFile] );

% do a 'whos' and see if there is only one item. If it's called Wnew, then copy to W
vars=whos;
svars=size(vars);
svars=svars(1);
for ind=1:svars
    if( strcmp( vars(ind).name, 'Wnew') )
        W = Wnew;
    end
end

if( class(W) == 'single' )
    Wnew = double(W);
    W = Wnew;
end

cd SVMWeights;
addpath( '../' );

date=datestr(now);

for ni=1:9
    for mu=1:8
        if( is_silent == 1 )
            [msg,err]=sprintf( 'Exporting SVMWEight ni=%d mu=%d', ni, mu );
            disp( msg );
        end

        SVMExport( squeeze(W(ni,mu,:,:)), ni, mu, SVMFile, date, certVersion, prefix );
    end
end
