%% Show the saved results
global XS1 WS1 XXS1 XXL1 XXR1 XXSM1 XXSL1 XXSR1
global ling1_11 ling1_12 ling1_13 ling1_14
global ling1_21 ling1_22 ling1_23 ling1_24
global ling1_31 ling1_32 ling1_33 ling1_34
global ling1_41 ling1_42 ling1_43 ling1_44
global ling1_51 ling1_52 ling1_53 ling1_54
global ling1_61 ling1_62 ling1_63 ling1_64
global rank1_1 rank1_2 rank1_3 rank1_4 rank1_5
global cen1_1 cen1_2 cen1_3 cen1_4 cen1_5
global sim1_11 sim1_12 sim1_13 sim1_14 sim1_15
global sim1_21 sim1_22 sim1_23 sim1_24 sim1_25
global sim1_31 sim1_32 sim1_33 sim1_34 sim1_35
global sim1_41 sim1_42 sim1_43 sim1_44 sim1_45
global sim1_51 sim1_52 sim1_53 sim1_54 sim1_55

%% Linguistic Ratings and Weights
set(findobj(hObject,'Tag','edit1_11'),'string', num2str(ling1_11));
set(findobj(hObject,'Tag','edit1_12'),'string', num2str(ling1_12));
set(findobj(hObject,'Tag','edit1_13'),'string', num2str(ling1_13));
set(findobj(hObject,'Tag','edit1_14'),'string', num2str(ling1_14));

set(findobj(hObject,'Tag','edit1_21'),'string', num2str(ling1_21));
set(findobj(hObject,'Tag','edit1_22'),'string', num2str(ling1_22));
set(findobj(hObject,'Tag','edit1_23'),'string', num2str(ling1_23));
set(findobj(hObject,'Tag','edit1_24'),'string', num2str(ling1_24));

set(findobj(hObject,'Tag','edit1_31'),'string', num2str(ling1_31));
set(findobj(hObject,'Tag','edit1_32'),'string', num2str(ling1_32));
set(findobj(hObject,'Tag','edit1_33'),'string', num2str(ling1_33));
set(findobj(hObject,'Tag','edit1_34'),'string', num2str(ling1_34));

set(findobj(hObject,'Tag','edit1_41'),'string', num2str(ling1_41));
set(findobj(hObject,'Tag','edit1_42'),'string', num2str(ling1_42));
set(findobj(hObject,'Tag','edit1_43'),'string', num2str(ling1_43));
set(findobj(hObject,'Tag','edit1_44'),'string', num2str(ling1_44));

set(findobj(hObject,'Tag','edit1_51'),'string', num2str(ling1_51));
set(findobj(hObject,'Tag','edit1_52'),'string', num2str(ling1_52));
set(findobj(hObject,'Tag','edit1_53'),'string', num2str(ling1_53));
set(findobj(hObject,'Tag','edit1_54'),'string', num2str(ling1_54));

set(findobj(hObject,'Tag','edit1_61'),'string', num2str(ling1_61));
set(findobj(hObject,'Tag','edit1_62'),'string', num2str(ling1_62));
set(findobj(hObject,'Tag','edit1_63'),'string', num2str(ling1_63));
set(findobj(hObject,'Tag','edit1_64'),'string', num2str(ling1_64));

%% Rank & Centroid
set(findobj(hObject,'Tag','edit1_rank1'),'string', rank1_1);
set(findobj(hObject,'Tag','edit1_rank2'),'string', rank1_2);
set(findobj(hObject,'Tag','edit1_rank3'),'string', rank1_3);
set(findobj(hObject,'Tag','edit1_rank4'),'string', rank1_4);
set(findobj(hObject,'Tag','edit1_rank5'),'string', rank1_5);

set(findobj(hObject,'Tag','edit1_cen1'),'string', num2str(cen1_1));
set(findobj(hObject,'Tag','edit1_cen2'),'string', num2str(cen1_2));
set(findobj(hObject,'Tag','edit1_cen3'),'string', num2str(cen1_3));
set(findobj(hObject,'Tag','edit1_cen4'),'string', num2str(cen1_4));
set(findobj(hObject,'Tag','edit1_cen5'),'string', num2str(cen1_5));

%% Similarity
set(findobj(hObject,'Tag','edit1_sim11'),'string', num2str(sim1_11));
set(findobj(hObject,'Tag','edit1_sim12'),'string', num2str(sim1_12));
set(findobj(hObject,'Tag','edit1_sim13'),'string', num2str(sim1_13));
set(findobj(hObject,'Tag','edit1_sim14'),'string', num2str(sim1_14));
set(findobj(hObject,'Tag','edit1_sim15'),'string', num2str(sim1_15));

set(findobj(hObject,'Tag','edit1_sim21'),'string', num2str(sim1_21));
set(findobj(hObject,'Tag','edit1_sim22'),'string', num2str(sim1_22));
set(findobj(hObject,'Tag','edit1_sim23'),'string', num2str(sim1_23));
set(findobj(hObject,'Tag','edit1_sim24'),'string', num2str(sim1_24));
set(findobj(hObject,'Tag','edit1_sim25'),'string', num2str(sim1_25));

set(findobj(hObject,'Tag','edit1_sim31'),'string', num2str(sim1_31));
set(findobj(hObject,'Tag','edit1_sim32'),'string', num2str(sim1_32));
set(findobj(hObject,'Tag','edit1_sim33'),'string', num2str(sim1_33));
set(findobj(hObject,'Tag','edit1_sim34'),'string', num2str(sim1_34));
set(findobj(hObject,'Tag','edit1_sim35'),'string', num2str(sim1_35));

set(findobj(hObject,'Tag','edit1_sim41'),'string', num2str(sim1_41));
set(findobj(hObject,'Tag','edit1_sim42'),'string', num2str(sim1_42));
set(findobj(hObject,'Tag','edit1_sim43'),'string', num2str(sim1_43));
set(findobj(hObject,'Tag','edit1_sim44'),'string', num2str(sim1_44));
set(findobj(hObject,'Tag','edit1_sim45'),'string', num2str(sim1_45));

set(findobj(hObject,'Tag','edit1_sim51'),'string', num2str(sim1_51));
set(findobj(hObject,'Tag','edit1_sim52'),'string', num2str(sim1_52));
set(findobj(hObject,'Tag','edit1_sim53'),'string', num2str(sim1_53));
set(findobj(hObject,'Tag','edit1_sim54'),'string', num2str(sim1_54));
set(findobj(hObject,'Tag','edit1_sim55'),'string', num2str(sim1_55));


%% Figures - Rank & Risk Band
%% RANK BAND

for i=1:5
    switch i
        case 1
            axes(handles.axes1_rankband1);
            set(handles.axes1_rankband1, 'Visible', 'on');
        case 2
            axes(handles.axes1_rankband2);
            set(handles.axes1_rankband2, 'Visible', 'on');
        case 3
            axes(handles.axes1_rankband3);
            set(handles.axes1_rankband3, 'Visible', 'on');
        case 4
            axes(handles.axes1_rankband4);
            set(handles.axes1_rankband4, 'Visible', 'on');
        case 5
            axes(handles.axes1_rankband5);
            set(handles.axes1_rankband5, 'Visible', 'on');
    end
    plot(XXS1(6-i),1,'r*', 'linewidth', 2); hold on; grid on;
    plot([XXL1(6-i) XXR1(6-i)],[1 1], 'r-','linewidth',1.5); hold on;
    axis tight
    axis on
    set(gca,'ytick',[]);
    axis([0,10,0.5,1.5]);
    switch i
        case 1
            set(findobj(hObject,'Tag','edit1_cen1'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit1_rank1'),'string','Commodities');
                case 2
                    set(findobj(hObject,'Tag','edit1_rank1'),'string','Stocks');
                case 3
                    set(findobj(hObject,'Tag','edit1_rank1'),'string','Gold/Diamonds');
                case 4
                    set(findobj(hObject,'Tag','edit1_rank1'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit1_rank1'),'string','Long-term Bonds');
            end
        case 2
            set(findobj(hObject,'Tag','edit1_cen2'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit1_rank2'),'string','Commodities');
                case 2
                    set(findobj(hObject,'Tag','edit1_rank2'),'string','Stocks');
                case 3
                    set(findobj(hObject,'Tag','edit1_rank2'),'string','Gold/Diamonds');
                case 4
                    set(findobj(hObject,'Tag','edit1_rank2'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit1_rank2'),'string','Long-term Bonds');
            end
        case 3
            set(findobj(hObject,'Tag','edit1_cen3'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit1_rank3'),'string','Commodities');
                case 2
                    set(findobj(hObject,'Tag','edit1_rank3'),'string','Stocks');
                case 3
                    set(findobj(hObject,'Tag','edit1_rank3'),'string','Gold/Diamonds');
                case 4
                    set(findobj(hObject,'Tag','edit1_rank3'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit1_rank3'),'string','Long-term Bonds');
            end
        case 4
            set(findobj(hObject,'Tag','edit1_cen4'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit1_rank4'),'string','Commodities');
                case 2
                    set(findobj(hObject,'Tag','edit1_rank4'),'string','Stocks');
                case 3
                    set(findobj(hObject,'Tag','edit1_rank4'),'string','Gold/Diamonds');
                case 4
                    set(findobj(hObject,'Tag','edit1_rank4'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit1_rank4'),'string','Long-term Bonds');
            end
        case 5
            set(findobj(hObject,'Tag','edit1_cen5'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit1_rank5'),'string','Commodities');
                case 2
                    set(findobj(hObject,'Tag','edit1_rank5'),'string','Stocks');
                case 3
                    set(findobj(hObject,'Tag','edit1_rank5'),'string','Gold/Diamonds');
                case 4
                    set(findobj(hObject,'Tag','edit1_rank5'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit1_rank5'),'string','Long-term Bonds');
            end
    end
end
%% Risk Band
% % % % figure
% % % % % % % % % % % % title('Risk Band')
for i=1:5
    switch i
        case 1
            axes(handles.axes1_riskband1);
            set(handles.axes1_riskband1, 'Visible', 'on');
        case 2
            axes(handles.axes1_riskband2);
            set(handles.axes1_riskband2, 'Visible', 'on');
        case 3
            axes(handles.axes1_riskband3);
            set(handles.axes1_riskband3, 'Visible', 'on');
        case 4
            axes(handles.axes1_riskband4);
            set(handles.axes1_riskband4, 'Visible', 'on');
        case 5
            axes(handles.axes1_riskband5);
            set(handles.axes1_riskband5, 'Visible', 'on');
    end
    plot(xxsm(6-i),1,'r*', 'linewidth', 2); hold on; grid on;
    plot([xxsl(6-i) xxsr(6-i)],[1 1], 'r-','linewidth',1.5); hold on;
    axis tight
    set(gca,'ytick',[]);
    axis([0,10,0.5,1.5]);
    
end

