%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Investment Judgment Advisor
%%% Programed by Jhiin Joo specifically for MAC users
%%% March 3, 2009
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global Xs Ws MFsf_nega  Special XSp WSp
global counter Cs S
global xxs xxl xxr a
global xxsm xxsl xxsr
global XS2 WS2 XS3 WS3 XS1 WS1
global Xs1 Xs2 Xs3 Xs4 Xs5
global XS3 WS3

SETs; %% Set all the colors BLACK ( default)
cla(handles.axes3_rankband1);
cla(handles.axes3_rankband2);
cla(handles.axes3_rankband3);
cla(handles.axes3_rankband4);
cla(handles.axes3_rankband5);
cla(handles.axes3_riskband1);
cla(handles.axes3_riskband2);
cla(handles.axes3_riskband3);
cla(handles.axes3_riskband4);
cla(handles.axes3_riskband5);



Xs1=[]; Xs2=[]; Xs3=[]; Xs4=[]; Xs5=[];
Xs1=Xs(1,:);
Xs2=Xs(2,:);
Xs3=Xs(3,:);
Xs4=Xs(4,:);
Xs5=Xs(5,:);
%% CHOSEN LINGUISTIC RATINGS AND WEIGHTS

XstoWords3; %%RATINGS
WstoWords3; %% WEIGHTS


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
%% RANK BAND

for i=1:5
    switch i
        case 1
            axes(handles.axes3_rankband1);
            set(handles.axes3_rankband1, 'Visible', 'on');
        case 2
            axes(handles.axes3_rankband2);
            set(handles.axes3_rankband2, 'Visible', 'on');
        case 3
            axes(handles.axes3_rankband3);
            set(handles.axes3_rankband3, 'Visible', 'on');
        case 4
            axes(handles.axes3_rankband4);
            set(handles.axes3_rankband4, 'Visible', 'on');
        case 5
            axes(handles.axes3_rankband5);
            set(handles.axes3_rankband5, 'Visible', 'on');
    end
    plot(xxs(6-i),1,'r*', 'linewidth', 2); hold on; grid on;
    plot([xxl(6-i) xxr(6-i)],[1 1], 'r-','linewidth',1.5); hold on;
    axis tight
    set(gca,'ytick',[]);
    axis([0,10,0.5,1.5]);
    switch i
        case 1
            set(findobj(hObject,'Tag','edit3_cen1'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit3_rank1'),'string','Commodity Market');
                case 2
                    set(findobj(hObject,'Tag','edit3_rank1'),'string','Stock Market');
                case 3
                    set(findobj(hObject,'Tag','edit3_rank1'),'string','Gold');
                case 4
                    set(findobj(hObject,'Tag','edit3_rank1'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit3_rank1'),'string','Long-term Bonds');
            end
        case 2
            set(findobj(hObject,'Tag','edit3_cen2'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit3_rank2'),'string','Commodity Market');
                case 2
                    set(findobj(hObject,'Tag','edit3_rank2'),'string','Stock Market');
                case 3
                    set(findobj(hObject,'Tag','edit3_rank2'),'string','Gold');
                case 4
                    set(findobj(hObject,'Tag','edit3_rank2'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit3_rank2'),'string','Long-term Bonds');
            end
        case 3
            set(findobj(hObject,'Tag','edit3_cen3'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit3_rank3'),'string','Commodity Market');
                case 2
                    set(findobj(hObject,'Tag','edit3_rank3'),'string','Stock Market');
                case 3
                    set(findobj(hObject,'Tag','edit3_rank3'),'string','Gold');
                case 4
                    set(findobj(hObject,'Tag','edit3_rank3'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit3_rank3'),'string','Long-term Bonds');
            end
        case 4
            set(findobj(hObject,'Tag','edit3_cen4'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit3_rank4'),'string','Commodity Market');
                case 2
                    set(findobj(hObject,'Tag','edit3_rank4'),'string','Stock Market');
                case 3
                    set(findobj(hObject,'Tag','edit3_rank4'),'string','Gold');
                case 4
                    set(findobj(hObject,'Tag','edit3_rank4'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit3_rank4'),'string','Long-term Bonds');
            end
        case 5
            set(findobj(hObject,'Tag','edit3_cen5'),'string', num2str(Cs(6-i),'%1.2f'));
            switch a(6-i)
                case 1
                    set(findobj(hObject,'Tag','edit3_rank5'),'string','Commodity Market');
                case 2
                    set(findobj(hObject,'Tag','edit3_rank5'),'string','Stock Market');
                case 3
                    set(findobj(hObject,'Tag','edit3_rank5'),'string','Gold');
                case 4
                    set(findobj(hObject,'Tag','edit3_rank5'),'string','Real Estate');
                case 5
                    set(findobj(hObject,'Tag','edit3_rank5'),'string','Long-term Bonds');
            end
    end
end

%% Risk Band
% % % % figure
% % % % % % % % % % % % title('Risk Band')
for i=1:5
    switch i
        case 1
            axes(handles.axes3_riskband1);
            set(handles.axes3_riskband1, 'Visible', 'on');
        case 2
            axes(handles.axes3_riskband2);
            set(handles.axes3_riskband2, 'Visible', 'on');
        case 3
            axes(handles.axes3_riskband3);
            set(handles.axes3_riskband3, 'Visible', 'on');
        case 4
            axes(handles.axes3_riskband4);
            set(handles.axes3_riskband4, 'Visible', 'on');
        case 5
            axes(handles.axes3_riskband5);
            set(handles.axes3_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

%% SIMILARITY

S1=[];S2=[];S3=[];S4=[];S5=[];
S1=S(1,:);
S2=S(2,:);
S3=S(3,:);
S4=S(4,:);
S5=S(5,:);

SimilarityResult3;



