function buttonsvdPGA(hObject, eventdata, Empty_Button, Buttons, AxesSVD, SVDText, rbplotsvd, RegSlider, RegText, usmn, usmf)
data = get(Empty_Button,'UserData');


data.issvd = 0;

if (isfield(data,'isdata')) && (data.isdata == 1)
    [k,n] = size(data.D);
    
    set(hObject, 'Enable','off');
    set(gcf,'Pointer','watch');
    pause(1.E-10);
    
    if data.isamp == 0
        data.ampl = ones(1,n);
        data.U = data.U0;
        data.S = data.S0;
        data.V = data.V0;
    else
        tim = cputime;
        
        [data.U,data.S,data.V] = svds(data.D*diag(data.ampl), data.SVDco);
        
        data.timeSVD = data.timeSVD+cputime-tim;
        set(InfoText(11), 'String', [num2str(data.timeSVD, '%2.2f'), ' s']);
        
        for i=1:data.SVDco
            if sum(max(data.V(:,i),0).^2) < sum(min(data.V(:,i),0).^2)
                data.U(:,i) = -data.U(:,i);
                data.V(:,i) = -data.V(:,i);
            end
        end
    end
    
    set(gcf,'Pointer','arrow');
    set(hObject, 'Enable','on');
    
    i1 = 1;
    i2 = min(data.SVDco, 3);
    
    if get(rbplotsvd(1), 'Value') == 1
        plot(AxesSVD, data.time, data.U(:,1:min(data.SVDco, 3)), 'Linewidth',2);
        axis(AxesSVD,'tight');
        xlabel(AxesSVD,'time');
    elseif get(rbplotsvd(2), 'Value') == 1
        semilogy(AxesSVD, i1:i2, diag(data.S(i1:i2, i1:i2)),' k-.o', 'Linewidth',2);
        axis(AxesSVD,'tight');
        yl = get(AxesSVD, 'Ylim');
        set(AxesSVD, 'Xlim', [i1-.1, i2+.1], 'Ylim', [0.9, 1.1].*yl);
        xlabel(AxesSVD,'singular values');
    else
        plot(AxesSVD, data.x, data.V(:,1:min(data.SVDco, 3)), 'Linewidth',2);
        axis(AxesSVD,'tight');
        xlabel(AxesSVD,'channel');
    end
    
    if (isfield(data,'isbd')*isfield(data,'isnovctrs') == 1) && (data.isbd*data.isnovctrs == 1)
        if get(RegSlider(8), 'Value') > 0
            if (isfield(data,'isgivenspec') == 1) && (data.isgivenspec == 1)
                onoffButton(Buttons,4,[]);
            end
        else
            onoffButton(Buttons,4,[]);
        end
    end
    
    data.issvd = 1;
    Sings = [];
    for i = 1:min(size(data.S,1),size(data.S,2))
        if i<10
            Sings = [Sings ' '+string(i)+' : '+string(data.S(i,i))];
%             Sings = [Sings '( '+string(i)+' ): '+string(data.S(i,i))];
%             Sings = [Sings ' ['+string(i)+']  '+string(data.S(i,i))];
        else
            Sings = [Sings ''+string(i)+': '+string(data.S(i,i))];
%             Sings = [Sings '('+string(i)+'): '+string(data.S(i,i))];
%             Sings = [Sings '['+string(i)+'] '+string(data.S(i,i))];
        end
%         Sings = [Sings string(data.S(i,i))];
    end
    set(SVDText(1),'String',Sings);
    set(SVDText(2),'String','Singular values: ')
    set(SVDText(2),'Backgroundcolor',[0.8500 0.3250 0.0980])
    
    data.isred = 0;
    data.issol = 0;
    data.islive = 0;
    data.issol = 0;
    data.livet = [];
    set(usmn,'Value',0);
    set(usmf,'Value',1);
    SliderOnOffPGA(RegSlider, RegText, data, 0);
    
    set(Empty_Button,'UserData',data);
end
