No BSD License  

Highlights from
Gauss Triangularization Method

image thumbnail
from Gauss Triangularization Method by Anthony Zaganas
The vector of pivot elements during LU is formed for special matrices and equivalent ones.

main(varargin)
function varargout = main(varargin)

if nargin == 0  % LAUNCH GUI
    
    global ffflag;
    

	fig = openfig(mfilename,'reuse');
    movegui(fig,'center');    
	handles = guihandles(fig);
    handles.WArray=0;               %arxikos pinakas
    handles.diastasi=0;             %diastasi arxikou pinaka
    handles.epan=0;                 %arithmos epanalipseon algorithmou
    handles.epan_backup=10000;      %backup arithmou epanalipsewn algorithmou
    handles.mae_grammwn=2;          %megistos arithmos enallagwn grammwn
    handles.mae_stilwn=2;           %megistos arithmos enallagwn stilwn
    handles.minus_row_mult=0;       %arithmos pollaplasiasmwn grammwn me -1
    handles.minus_column_mult=0;    %arithmos pollaplasiasmwn stilwn me -1
    handles.MArray=0;               %pinakas kataxwrisis domwn odigwn stoixeiwn
    handles.deiktisMPointer=0;      %deiktis pinaka kataxwrisis domwn odigwn stoixeiwn
    handles.XYArray=0;              %pinakas kataxwrisis enallagwn grammwn arxikou pinaka
    handles.ZWArray=0;              %pinakas kataxwrisis enallagwn stilwn arxikou pinaka
    handles.RArray=0;               %pinakas kataxwrisis tuxaiwn deiktwn grammwn megistwn stoixeiwn
    handles.SArray=0;               %pinakas kataxwrisis tuxaiwn deiktwn stilwn megistwn stoixeiwn
    handles.MinusRowArray=0;        %pinakas kataxwrisis twn tuxaiwn grammwn pou pollaplasiazontai me -1
    handles.MinusColumnArray=0;     %pinakas kataxwrisis twn tuxaiwn grammwn pou pollaplasiazontai me -1
    handles.hPointer=0;             %deiktis arithmou epanalipsis algorithmou
    handles.GaussOlikiMethod=1;     %1: anazitisi kata stiles 2: anazitisi kata grammes 3: tuxaia anazitisi megistou stoixeiou
    guidata(fig, handles);

  
	if nargout > 0
		varargout{1} = fig;
	end

elseif ischar(varargin{1})

	try
		[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
	catch
		disp(lasterr);
	end

end

% --------------------------------------------------------------------
% ----------------- General Purpose Functions-------------------------
% --------------------------------------------------------------------
function mutual_exclude(off)
set(off,'Value',0);

function self_exclude(off)
off_value=get(off,'Value');
if off_value==0
    set(off,'Value',1);
end

function varargout = fgrMain_CloseRequestFcn(h, eventdata, handles, varargin)
psbExit_Callback(h, eventdata, handles)

% --------------------------------------------------------------------
function varargout = lsbPivotVectors_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.lsbPivotVectors.
a=get(gcf,'SelectionType');
lsbPivotVectorsValue=get(handles.lsbPivotVectors,'Value');
if strcmp(a,'normal')
    set(handles.edtGoToPivot,'String',lsbPivotVectorsValue);
    set(handles.lsbPivotVectors2,'Value',lsbPivotVectorsValue);
else
    if handles.GaussOlikiMethod==3
        determine(handles.WArray,handles.diastasi,handles.MArray(lsbPivotVectorsValue,:),handles.XYArray(lsbPivotVectorsValue,:),handles.ZWArray(lsbPivotVectorsValue,:),handles.GaussOlikiMethod,handles.RArray(lsbPivotVectorsValue,:),handles.SArray(lsbPivotVectorsValue,:),handles.MinusRowArray(lsbPivotVectorsValue,:),handles.MinusColumnArray(lsbPivotVectorsValue,:));
    else
        determine(handles.WArray,handles.diastasi,handles.MArray(lsbPivotVectorsValue,:),handles.XYArray(lsbPivotVectorsValue,:),handles.ZWArray(lsbPivotVectorsValue,:),handles.GaussOlikiMethod,0,0,handles.MinusRowArray(lsbPivotVectorsValue,:),handles.MinusColumnArray(lsbPivotVectorsValue,:));
    end
end
% --------------------------------------------------------------------
function varargout = psbSettingsOnBoard_Callback(h, eventdata, handles, varargin)
width_before=get(handles.fgrMain,'Position');
string_before=get(handles.psbSettingsOnBoard,'String');
if strcmp(string_before,'>>')
    set(handles.psbSettingsOnBoard,'String','<<');
    set(handles.fgrMain,'Position',[width_before(1) width_before(2) width_before(3)+width_before(3)/3 width_before(4) ]);
    movegui(handles.fgrMain,'center');
else
    set(handles.psbSettingsOnBoard,'String','>>');
    set(handles.fgrMain,'Position',[width_before(1) width_before(2) width_before(3)-width_before(3)/4  width_before(4) ]);
    movegui(handles.fgrMain,'center');
end

% --------------------------------------------------------------------
function varargout = lsbPivotVectors2_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.lsbPivotVectors2.

% --------------------------------------------------------------------
function varargout = edtPivotVectors_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edtPivotVectors.

% --------------------------------------------------------------------
function varargout = edtEquivalentMatrices_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edtEquivalentMatrices.

% --------------------------------------------------------------------
function varargout = edtTimeSoFar_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edtTimeSoFar.

% --------------------------------------------------------------------
function varargout = edtTimeLeft_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edtTimeLeft.

function A=cyclic_matrix_production(a,n)
for j=1:n
      A(j,:)=a;
      x=a(n);
      for i=n:-1:2
         a(i)=a(i-1);
      end
      a(1)=x;
end

function [i,j]=find_max_indices(B)
[y,r]=max(B);
[z,s]=max(y);
j=s;
i=r(s);

function [i,j]=find_max_per_row_indices(B)
[y,r]=max(B');
[z,s]=max(y);
i=s;
j=r(s);

function [i,j]=find_rand_max_indices(B)
[m,n]=find_max_indices(B);
[o,p]=find_max_per_row_indices(B);
a=B(m,n);
deiktisC=1;
C(deiktisC,1)=B(m,n);
C(deiktisC,2)=m;
C(deiktisC,3)=n;
deiktisC=deiktisC+1;
C(deiktisC,1)=B(o,p);
C(deiktisC,2)=o;
C(deiktisC,3)=p;
for deiktis1=1:length(B(:,1))
    for deiktis2=1:length(B(1,:))
        if B(deiktis1,deiktis2)==a
            if deiktis1~=m | deiktis2~=n
                if deiktis1~=o | deiktis2~=p
                    deiktisC=deiktisC+1;
                    C(deiktisC,1)=B(deiktis1,deiktis2);
                    C(deiktisC,2)=deiktis1;
                    C(deiktisC,3)=deiktis2;
                end
            end
        end
    end
end
if deiktisC==2
    i=o;
    j=p;
else
    w=round(rand*(deiktisC-3))+3;
    i=C(w,2);
    j=C(w,3);
end

function [A,m]=Gauss_Oliki(B,n)
for k=1:n-1
    [r(k),s(k)]=find_max_indices(abs(B(k:n,k:n)));
    B=row_swap(B,n,k,r(k)+k-1);
    B=column_swap(B,n,k,s(k)+k-1);
    m(k)=abs(B(k,k));
    for j=k+1:n
        B(j,k)=B(j,k)/B(k,k);
    end
    for i=k+1:n
        for j=k+1:n
            B(i,j)=B(i,j)-B(i,k)*B(k,j);
        end
    end
end
m(n)=abs(B(n,n));
A=B;

function [A,m,random_i,random_j]=Gauss_Oliki_Random(B,n)
for k=1:n-1
    [r(k),s(k)]=find_rand_max_indices(abs(B(k:n,k:n)));
    B=row_swap(B,n,k,r(k)+k-1);
    B=column_swap(B,n,k,s(k)+k-1);
    m(k)=abs(B(k,k));
    for j=k+1:n
        B(j,k)=B(j,k)/B(k,k);
    end
    for i=k+1:n
        for j=k+1:n
            B(i,j)=B(i,j)-B(i,k)*B(k,j);
        end
    end
end
m(n)=abs(B(n,n));
r(n)=1;
s(n)=1;
random_i=r;
random_j=s;
A=B;

function [A,m]=Gauss_Oliki_Row(B,n)
for k=1:n-1
    [r(k),s(k)]=find_max_per_row_indices(abs(B(k:n,k:n)));
    B=row_swap(B,n,k,r(k)+k-1);
    B=column_swap(B,n,k,s(k)+k-1);
    m(k)=abs(B(k,k));
    for j=k+1:n
        B(j,k)=B(j,k)/B(k,k);
    end
    for i=k+1:n
        for j=k+1:n
            B(i,j)=B(i,j)-B(i,k)*B(k,j);
        end
    end
end
m(n)=abs(B(n,n));
A=B;

function [A,x,y] = random_column_swap(B,n)
A=B;
x=round(rand*(n-1)+1);
y=round(rand*(n-1)+1);
while y==x
    y=round(rand*(n-1)+1);
end
for j=1:n
    C(j)=A(j,x);
    A(j,x)=A(j,y);
    A(j,y)=C(j);
end

function [A,x,y] = random_column_swaps(B,n,m)
A=B;
z=round((rand*(m-1))+1);
for i=1:z
    [A,x(i),y(i)] = random_column_swap(A,n);
end

function [A,x,y] = random_row_swap(B,n)
A=B;
x=round(rand*(n-1)+1);
y=round(rand*(n-1)+1);
while y==x
    y=round(rand*(n-1)+1);
end
for j=1:n
    C(j)=A(x,j);
    A(x,j)=A(y,j);
    A(y,j)=C(j);
end


function [A,x,y] = random_row_swaps(B,n,m)
A=B;
z=round((rand*(m-1))+1);
for i=1:z
    [A,x(i),y(i)] = random_row_swap(A,n);
end

function [A,b]=rand_minone_row_mult(B,n,m)
% B: o arxikos pinakas
% n: i diastasi tou arxikou pinaka
% m: to plithos twn tuxaiwn grammwn pou tha pollaplasiastoun me -1
% A: o telikos isodunamos W(n-2,n) pinakas
% b: oi grammes pou pollaplasiastikan
A=B;
b=randperm(n);
for i=1:m
    A(b(i),:)=(-1)*A(b(i),:);
end
for j=m+1:n
    b(j)=0;
end

function [A,b]=rand_minone_column_mult(B,n,m)
% B: o arxikos pinakas
% n: i diastasi tou arxikou pinaka
% m: to plithos twn tuxaiwn stilwn pou tha pollaplasiastoun me -1
% A: o telikos isodunamos W(n-2,n) pinakas
% b: oi stiles pou pollaplasiastikan
A=B;
b=randperm(n);
for i=1:m
    A(:,b(i))=(-1)*A(:,b(i));
end
for j=m+1:n
    b(j)=0;
end


function A=rev_cyclic_matrix_production(a,n)
for j=1:n
      A(j,:)=a;
      x=a(1);
      for i=2:n
         a(i-1)=a(i);
      end
      a(n)=x;
end

function A = row_swap(B,n,x,y)
A=B;
for j=1:n
    C(j)=A(x,j);
    A(x,j)=A(y,j);
    A(y,j)=C(j);
end


function A = column_swap(B,n,x,y)
A=B;
for j=1:n
    C(j)=A(j,x);
    A(j,x)=A(j,y);
    A(j,y)=C(j);
end

% --------------------------------------------------------------------
% ------------------------- End --------------------------------------
% --------------------------------------------------------------------


% --------------------------------------------------------------------
% -------------------  The Start Toggle Button  ----------------------
% --------------------------------------------------------------------
function varargout = tgbStart_Callback(h, eventdata, handles, varargin)
global ffflag;

i=get(gcbo,'Value');
if i==1
    chkRatFracAppr_Callback(h, eventdata, handles);
    if handles.WArray==0
        msgbox({'No initial matrix is defined.','You can set one in: ','Settings >> Initial matrix >>'},'Error','help','','','modal');
        set(gcbo,'Value',0);
    else
        set(gcbo,'String','Stop','ForegroundColor',[0.5,0,0]);
        set(handles.psbInfo,'Enable','off');
        set(handles.psbDictSort,'Enable','off');
        set(handles.psbClear,'Enable','off');
        set(handles.lsbPivotVectors,'Enable','inactive');
        rand('state',sum(100*clock));
        psbStart_Callback(gcbo,[],guidata(gcbo));
    end
else
    if handles.deiktisMPointer==0
        set(handles.tgbStart,'String','Start');
    else
        set(handles.tgbStart,'String','Continue','ForegroundColor',[0,0.4,0]);
    end
    set(handles.psbInfo,'Enable','on');
    set(handles.psbDictSort,'Enable','on');
    set(handles.psbClear,'Enable','on');
    set(handles.lsbPivotVectors,'Enable','on');
    ffflag=0;
end

% ------------------  The Start Push Button  --------------------------
function varargout = psbStart_Callback(h, eventdata, handles, varargin)
global ffflag;

n=handles.diastasi;
W=handles.WArray;

methodos_number=handles.GaussOlikiMethod;

mae_grammwn=handles.mae_grammwn;
mae_stilwn=handles.mae_stilwn;
minus_row_mult=handles.minus_row_mult;
minus_column_mult=handles.minus_column_mult;
deiktisM=handles.deiktisMPointer;
if deiktisM==0 
    deiktisM=1;
    
    if methodos_number==1
        [Z,m]=Gauss_Oliki(W,n);
    else
        if methodos_number==2
            [Z,m]=Gauss_Oliki_Row(W,n);
        else
            [Z,m,r,s]=Gauss_Oliki_Random(W,n);
        end
    end
    
    M(deiktisM,:)=[m(:,1:6) m(:,(n-5):n)];
    XY(deiktisM,:)=zeros(1,2*mae_grammwn+1);
    ZW(deiktisM,:)=zeros(1,2*mae_stilwn+1);
    MR(deiktisM,:)=zeros(1,n);
    MC(deiktisM,:)=zeros(1,n);
    if methodos_number==3
        R(deiktisM,:)=r;
        S(deiktisM,:)=s;
    end
    set(handles.edtPivotVectors,'String','1');
    if get(handles.chkRatFracAppr,'Value')==1
        set(handles.lsbPivotVectors,'String',num2str(rats(M(:,4:9))));
    else
        set(handles.lsbPivotVectors,'String',num2str(M(:,4:9)));
    end
    set(handles.lsbPivotVectors,'Value',1);

    handles.deiktisMPointer=deiktisM;
    handles.MArray=M;
    handles.XYArray=XY;
    handles.ZWArray=ZW;
    handles.MinusRowArray=MR;
    handles.MinusColumnArray=MC;
    if methodos_number==3
        handles.RArray=R;
        handles.SArray=S;
    end
    guidata(gcbo,handles);
end



h=handles.hPointer;
M=handles.MArray;
XY=handles.XYArray;
ZW=handles.ZWArray;
R=handles.RArray;
S=handles.SArray;
MR=handles.MinusRowArray;
MC=handles.MinusColumnArray;
ffflag=1;
epan=handles.epan;

if epan~=0
    if h>=epan
        ffflag=0;
        msgbox({'Maximum number of equivalent matrices','is reached. Unlock search by clicking','','Settings >> Maximum Equivalents'},'Maximum Equivalents','help','','','modal');
        set(handles.tgbStart,'String','Continue','Value',0,'ForegroundColor',[0,0.4,0]);
        set(handles.psbInfo,'Enable','on');
        set(handles.psbDictSort,'Enable','on');
        set(handles.psbClear,'Enable','on');
        set(handles.lsbPivotVectors,'Enable','on');
    end
end

while ffflag==1

    h=h+1;
    handles.hPointer=h;
    guidata(gcbo,handles);
    
    set(handles.edtEquivalentMatrices,'String',num2str(h));

    %clear x y z w;
    mae_grammwn=str2num(get(handles.edtMaxRowSwaps,'String'));
    mae_stilwn=str2num(get(handles.edtMaxColumnSwaps,'String'));
    
    minus_row_mult=str2num(get(handles.edtMinusRowMults,'String'));
    minus_column_mult=str2num(get(handles.edtMinusColumnMults,'String'));
    
    handles.mae_grammwn=mae_grammwn;
    handles.mae_stilwn=mae_stilwn;
    handles.minus_row_mult=minus_row_mult;
    handles.minus_column_mult=minus_column_mult;
    guidata(gcbo,handles);
    
    [V,x,y]=random_row_swaps(W,n,mae_grammwn);
    [V,z,w]=random_column_swaps(V,n,mae_stilwn);
    
    [V,minusrow]=rand_minone_row_mult(V,n,minus_row_mult);
    [V,minuscol]=rand_minone_column_mult(V,n,minus_column_mult);
    
    if methodos_number==1
        [Z,m]=Gauss_Oliki(V,n);
    else
        if methodos_number==2
            [Z,m]=Gauss_Oliki_Row(V,n);
        else
            [Z,m,r,s]=Gauss_Oliki_Random(V,n);
        end
    end

    vrethike=1;
    voithdeiktis=0;
    while vrethike==1 & voithdeiktis < deiktisM
        voithdeiktis=voithdeiktis+1;
        if abs([m(:,1:6) m(:,(n-5):n)]-M(voithdeiktis,:))<10^(-4)
            vrethike=0;
        end
    end

    if vrethike==1
        deiktisM=deiktisM+1;
        M(deiktisM,:)=[m(:,1:6) m(:,(n-5):n)];
        XY(deiktisM,1:2*length(x)+1)=[x -1 y];
        ZW(deiktisM,1:2*length(z)+1)=[z -1 w];
        MR(deiktisM,:)=minusrow;
        MC(deiktisM,:)=minuscol;
        if methodos_number==3
            R(deiktisM,:)=r;
            S(deiktisM,:)=s;
        end

        handles.deiktisMPointer=deiktisM;
        handles.MArray=M;
        handles.XYArray=XY;
        handles.ZWArray=ZW;
        handles.MinusRowArray=MR;
        handles.MinusColumnArray=MC;
        if methodos_number==3
            handles.RArray=R;
            handles.SArray=S;
        end
        guidata(gcbo,handles);

    
        if get(handles.chkRatFracAppr,'Value')==1
            set(handles.lsbPivotVectors,'String',num2str(rats(M(:,4:9))));
            set(handles.lsbPivotVectors2,'String',num2str([M(:,1:3) M(:,10:12)]));
        else
            set(handles.lsbPivotVectors,'String',num2str(M(:,4:9)));
            set(handles.lsbPivotVectors2,'String',num2str([M(:,1:3) M(:,10:12)]));
        end;
        
        set(handles.lsbPivotVectors,'Value',length(M(:,1)));
        set(handles.lsbPivotVectors2,'Value',length(M(:,1)));
        set(handles.edtPivotVectors,'String',num2str(length(M(:,1))));
        set(handles.edtGoToPivot,'String',num2str(length(M(:,1))));
    end

    if norm(m,inf)>n
        XY(deiktisM,:)
        ZW(deiktisM,:)
        MR(deiktisM,:)
        MC(deiktisM,:)
        if methodos_number==3
            R(deiktisM,:)
            S(deiktisM,:)
        end
        V
        Z
        m
        norm(m,inf)
        ffflag=0;
        set(handles.tgbStart,'String','Found','Value',0,'ForegroundColor',[0,0.4,0]);
    end

    if epan~=0
        if h>=epan
            ffflag=0;
            msgbox({'Maximum number of equivalent matrices','is reached. Unlock search by clicking','','Settings >> Maximum Equivalents'},'Maximum Equivalents','help','','','modal');
            set(handles.tgbStart,'String','Continue','Value',0,'ForegroundColor',[0,0.4,0]);
            set(handles.psbInfo,'Enable','on');
            set(handles.psbDictSort,'Enable','on');
            set(handles.psbClear,'Enable','on');
            set(handles.lsbPivotVectors,'Enable','on');
        end
    end
    
    drawnow;
    
end
% --------------------------------------------------------------------
% --------------------------------------------------------------------
% --------------------------------------------------------------------

%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    File Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

% --------------------------------------------------------------------
% -------------------------- Load ------------------------------------
% --------------------------------------------------------------------
function varargout = mnuLoad_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    if handles.hPointer~=0
        button = questdlg({'This will clear your search data','Do you wish to continue?'},'Clear search data...','Yes','No','No');
        if strcmp(button,'Yes')
            katharismos_Callback(h,eventdata,handles);
            filename=loadgmtdlg;
        else
            return
        end
    else
        filename=loadgmtdlg;
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
    return
end
if ~strcmp(filename,'246cancel963_cancel')
    load(filename,'handles2','-mat');
    handles.WArray=handles2.WArray;                         %arxikos pinakas
    handles.diastasi=handles2.diastasi;                     %diastasi arxikou pinaka
    
    handles.mae_grammwn=handles2.mae_grammwn;               %megistos arithmos enallagwn grammwn
    handles.mae_stilwn=handles2.mae_stilwn;                 %megistos arithmos enallagwn stilwn
    
    
    handles.MArray=handles2.MArray;                         %pinakas kataxwrisis domwn odigwn stoixeiwn
    handles.deiktisMPointer=handles2.deiktisMPointer;       %deiktis pinaka kataxwrisis domwn odigwn stoixeiwn
    handles.XYArray=handles2.XYArray;                       %pinakas kataxwrisis enallagwn grammwn arxikou pinaka
    handles.ZWArray=handles2.ZWArray;                       %pinakas kataxwrisis enallagwn stilwn arxikou pinaka
    handles.MinusRowArray=handles2.MinusRowArray;           %pinakas kataxwrisis twn tuxaiwn grammwn pou pollaplasiazontai me -1
    handles.MinusColumnArray=handles2.MinusColumnArray;     %pinakas kataxwrisis twn tuxaiwn stilwn pou pollaplasiazontai me -1
    handles.RArray=handles2.RArray;                         %pinakas kataxwrisis tuxaiwn deiktwn grammwn megistwn stoixeiwn
    handles.SArray=handles2.SArray;                         %pinakas kataxwrisis tuxaiwn deiktwn stilwn megistwn stoixeiwn
    handles.hPointer=handles2.hPointer;                     %deiktis arithmou epanalipsis algorithmou
    
    handles.GaussOlikiMethod=handles2.GaussOlikiMethod;     %1: anazitisi kata stiles 2: anazitisi kata grammes 3: tuxaia anazitisi megistou stoixeiou
    guidata(handles.fgrMain,handles)

    M=handles.MArray;

    
    set(handles.txtSearchPivotMethod,'String',handles.GaussOlikiMethod);
    
    switch handles.GaussOlikiMethod
    case 1
        set(handles.mnuFindMaxColumn,'Checked','on');
        set(handles.mnuFindMaxRow,'Checked','off');
        set(handles.mnuFindRandMax,'Checked','off');
        set(handles.rdbFindMaxColumn,'Value',1);
        set(handles.rdbFindMaxRow,'Value',0);
        set(handles.rdbFindRandMax,'Value',0);
    case 2
        set(handles.mnuFindMaxColumn,'Checked','off');
        set(handles.mnuFindMaxRow,'Checked','on');
        set(handles.mnuFindRandMax,'Checked','off');
        set(handles.rdbFindMaxColumn,'Value',0);
        set(handles.rdbFindMaxRow,'Value',1);
        set(handles.rdbFindRandMax,'Value',0);
    case 3
        set(handles.mnuFindMaxColumn,'Checked','off');
        set(handles.mnuFindMaxRow,'Checked','off');
        set(handles.mnuFindRandMax,'Checked','on');
        set(handles.rdbFindMaxColumn,'Value',0);
        set(handles.rdbFindMaxRow,'Value',0);
        set(handles.rdbFindRandMax,'Value',1);
    end
    
    
    
    set(handles.txtMaximumRowPermutations,'String',handles.mae_grammwn);
    set(handles.txtMaximumColumnPermutations,'String',handles.mae_stilwn);
    set(handles.slider1,'Value',handles.mae_grammwn);
    set(handles.slider2,'Value',handles.mae_stilwn);
    slider1_Callback(h,eventdata,handles,varargin);
    slider2_Callback(h,eventdata,handles,varargin);

    
    set(handles.edtPivotVectors,'String',length(M(:,1)));
    set(handles.edtEquivalentMatrices,'String',num2str(handles.hPointer));
    set(handles.edtGoToPivot,'String',length(M(:,1)));
    set(handles.psbInfo,'Enable','on');

    if get(handles.chkRatFracAppr,'Value')==1
        set(handles.lsbPivotVectors,'String',num2str(rats(M(:,4:9))),'Value',length(M(:,1)));
        set(handles.lsbPivotVectors2,'String',num2str([M(:,1:3) M(:,10:12)]),'Value',length(M(:,1)));
    else
        set(handles.lsbPivotVectors,'String',num2str(M(:,4:9)),'Value',length(M(:,1)));
        set(handles.lsbPivotVectors2,'String',num2str([M(:,1:3) M(:,10:12)]),'Value',length(M(:,1)));
    end;
    
    if handles.deiktisMPointer==0
        set(handles.tgbStart,'String','Start','ForegroundColor',[0,0.4,0],'Value',0);
    else
        set(handles.tgbStart,'String','Continue','ForegroundColor',[0,0.4,0],'Value',0);
    end
end
% --------------------------------------------------------------------
% -------------------------------- End -------------------------------
% --------------------------------------------------------------------

% --------------------------------------------------------------------
% -------------------------- Save ------------------------------------
% --------------------------------------------------------------------
function varargout = mnuSave_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    filename=savegmtdlg;
    if ~strcmp(filename,'246cancel963_cancel')
        handles2=handles;
        save(filename,'handles2','-mat');
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end
% --------------------------------------------------------------------
% -------------------------------- End -------------------------------
% --------------------------------------------------------------------


% --------------------------------------------------------------------
% -------------------------- Exit ------------------------------------
% --------------------------------------------------------------------
function varargout = psbExit_Callback(h, eventdata, handles, varargin)
pos_size=get(handles.fgrMain,'Position');
dlg_pos=[pos_size(1)+pos_size(3)/3 pos_size(2)+pos_size(4)/3];
user_response = modaldlg(dlg_pos);
switch user_response
case {'no','cancel'}
    return
case 'yes'
    delete(handles.fgrMain)
end
% --------------------------------------------------------------------
% -------------------------------- End -------------------------------
% --------------------------------------------------------------------

%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    End File Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@






%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    Edit Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

% --------------------------------------------------------------------
% ----------------- Clear Search Data  -------------------------------
% --------------------------------------------------------------------
function varargout = psbClear_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    button = questdlg('Do you want to clear search data?','Clear search data...','Yes','No','Help','No');
    if strcmp(button,'Yes')
        katharismos_Callback(h,eventdata,handles);
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end

function varargout = katharismos_Callback(h, eventdata, handles, varargin)
        handles.WArray=0;               %arxikos pinakas
        handles.diastasi=0;             %diastasi arxikou pinaka
        handles.minus_row_mult=0;       %arithmos pollaplasiasmwn grammwn me -1
        handles.minus_column_mult=0;    %arithmos pollaplasiasmwn stilwn me -1

        handles.MArray=0;               %pinakas kataxwrisis domwn odigwn stoixeiwn
        handles.deiktisMPointer=0;      %deiktis pinaka kataxwrisis domwn odigwn stoixeiwn
        handles.XYArray=0;              %pinakas kataxwrisis enallagwn grammwn arxikou pinaka
        handles.ZWArray=0;              %pinakas kataxwrisis enallagwn stilwn arxikou pinaka
        handles.MinusRowArray=0;        %pinakas kataxwrisis twn tuxaiwn grammwn pou pollaplasiazontai me -1
        handles.MinusColumnArray=0;     %pinakas kataxwrisis twn tuxaiwn grammwn pou pollaplasiazontai me -1
        handles.hPointer=0;             %deiktis arithmou epanalipsis algorithmou
        handles.GaussOlikiMethod=1;
        guidata(gcbo,handles);
        set(handles.lsbPivotVectors,'String','','Value',1);
        set(handles.lsbPivotVectors2,'String','','Value',1);
        set(handles.edtPivotVectors,'String','0');
        set(handles.edtEquivalentMatrices,'String','0');
        set(handles.edtGoToPivot,'String','0');
        set(handles.txtSearchPivotMethod,'String','1');
        set(handles.tgbStart,'String','Start');
        set(handles.psbInfo,'Enable','off');
        set(handles.mnuTwoVectors,'Checked','off');
        set(handles.mnuFourVectors,'Checked','off');
        set(handles.mnuAbcdefghxVariables,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','on');
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuFindMaxColumn,'Checked','on');
        set(handles.mnuFindMaxRow,'Checked','off');
        set(handles.mnuFindRandMax,'Checked','off');
        set(handles.sldMinusRowMults,'Value',0);
        set(handles.sldMinusColumnMults,'Value',0);
        sldMinusRowMults_Callback(h,eventdata,handles);
        drawnow;
        sldMinusColumnMults_Callback(h,eventdata,handles);
% --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------


% --------------------------------------------------------------------
% ----------------- Go to pivot --------------------------------------
% --------------------------------------------------------------------
function varargout = mnuGoToPivot_Callback(h, eventdata, handles, varargin)
i=length(handles.MArray(:,1));
if handles.MArray~=0
    prompt  = {'Enter pivot number:'};
    title   = 'Go to pivot';
    lines= 1;
    answer  = inputdlg(prompt,title,lines);
    if eval(answer{1}) <= i 
        set(handles.lsbPivotVectors,'Value',eval(answer{1}))
        set(handles.lsbPivotVectors2,'Value',eval(answer{1}))
        set(handles.edtGoToPivot,'String',num2str(eval(answer{1})));
    else
        msgbox('The pivot number is incorrect','Error','help','','','modal')
    end
else
    msgbox('No pivots defined yet','Error','help','','','modal')
end
% --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------


% --------------------------------------------------------------------
% ----------------- Clear Command Window -----------------------------
% --------------------------------------------------------------------
function varargout = psbClc_Callback(h, eventdata, handles, varargin)
clc;
% --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------


%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    End Edit Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    View Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



% --------------------------------------------------------------------
% ----------------- Display Initial Matrix ---------------------------
% --------------------------------------------------------------------

function varargout = psbDisplayInitial_Callback(h, eventdata, handles, varargin)
A=handles.WArray
msgbox({'The initial matrix is displayed in the','Command Window'},'Show Initial','help','','','modal')

% --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------


% --------------------------------------------------------------------
% ----------------- Pivot Information --------------------------------
% --------------------------------------------------------------------

function varargout = psbInfo_Callback(h, eventdata, handles, varargin)
lsbPivotVectorsValue=get(handles.lsbPivotVectors,'Value');
if handles.GaussOlikiMethod==3
    determine(handles.WArray,handles.diastasi,handles.MArray(lsbPivotVectorsValue,:),handles.XYArray(lsbPivotVectorsValue,:),handles.ZWArray(lsbPivotVectorsValue,:),handles.GaussOlikiMethod,handles.RArray(lsbPivotVectorsValue,:),handles.SArray(lsbPivotVectorsValue,:),handles.MinusRowArray(lsbPivotVectorsValue,:),handles.MinusColumnArray(lsbPivotVectorsValue,:));
else
    determine(handles.WArray,handles.diastasi,handles.MArray(lsbPivotVectorsValue,:),handles.XYArray(lsbPivotVectorsValue,:),handles.ZWArray(lsbPivotVectorsValue,:),handles.GaussOlikiMethod,0,0,handles.MinusRowArray(lsbPivotVectorsValue,:),handles.MinusColumnArray(lsbPivotVectorsValue,:));
end

function varargout = mnuPivotInformationGeneral_Callback(h, eventdata, handles, varargin)
if strcmp(get(handles.psbInfo,'Enable'),'on')
    psbInfo_Callback(h, eventdata, handles)
else
    if handles.MArray==0
        msgbox('No pivots defined yet.','Error','help','','','modal')
    elseif strcmp(get(handles.mnuDictSortUnsort,'Checked'),'off')
        msgbox({'There must be unsorted results in the','pivot vectors listbox in order to see' , 'general information of the pivot vector...','You can unsort the results by clicking:','','View >> Dictionary Sort >> Unsorted results'},'General Info','help','','','modal')
    else
        msgbox('You should press the Stop button first.','Error','help','','','modal')
    end
end

function varargout = mnuPivotInformation_Callback(h, eventdata, handles, varargin)
M=handles.MArray;
m=varargin{1};
if strcmp(get(handles.tgbStart,'String'),'Continue')
    pos_size=get(handles.fgrMain,'Position');
    columnarrayinfo_pos=[pos_size(1)+pos_size(3)/6 pos_size(2)+pos_size(4)/4];
    ColumnArrayInfo(M(:,m),m,columnarrayinfo_pos);
elseif M==0
    msgbox('No pivots defined yet.','Error','help','','','modal')
else
    msgbox('You should press the Stop button first.','Error','help','','','modal')
end

    % --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------


% --------------------------------------------------------------------
% ----------------- Dictionary Sort ----------------------------------
% --------------------------------------------------------------------

function varargout = psbDictSort_Callback(h, eventdata, handles, varargin)
M=handles.MArray;
N=sortrows(M,[4 5 6 7 8 9]);
set(handles.lsbPivotVectors,'String',num2str(N(:,4:9)));

function varargout = mnuDictSort4_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    M=handles.MArray;
    if M~=0
        N=sortrows(M,[4 5 6 7 8 9]);
        if get(handles.chkRatFracAppr,'Value')==1
            set(handles.lsbPivotVectors,'String',num2str(rats(N(:,4:9))));
        else
            set(handles.lsbPivotVectors,'String',num2str(N(:,4:9)));
        end
        set(handles.mnuDictSort4,'Checked','on');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','off');
        set(handles.psbInfo,'Enable','off');
        set(handles.lsbPivotVectors,'Enable','inactive');
    else
        msgbox('No pivots defined yet.','Error','help','','','modal')
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end


function varargout = mnuDictSort5_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    M=handles.MArray;
    if M~=0
        N=sortrows(M,[5 6 7 8 9]);
        if get(handles.chkRatFracAppr,'Value')==1
            set(handles.lsbPivotVectors,'String',num2str(rats(N(:,4:9))));
        else
            set(handles.lsbPivotVectors,'String',num2str(N(:,4:9)));
        end
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','on');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','off');
        set(handles.psbInfo,'Enable','off');
        set(handles.lsbPivotVectors,'Enable','inactive');
    else
        msgbox('No pivots defined yet.','Error','help','','','modal')
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end

function varargout = mnuDictSort6_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    M=handles.MArray;
    if M~=0
        N=sortrows(M,[6 7 8 9]);
        if get(handles.chkRatFracAppr,'Value')==1
            set(handles.lsbPivotVectors,'String',num2str(rats(N(:,4:9))));
        else
            set(handles.lsbPivotVectors,'String',num2str(N(:,4:9)));
        end
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','on');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','off');
        set(handles.psbInfo,'Enable','off');
        set(handles.lsbPivotVectors,'Enable','inactive');
    else
        msgbox('No pivots defined yet.','Error','help','','','modal')
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end

function varargout = mnuDictSortn5_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    M=handles.MArray;
    if M~=0
        N=sortrows(M,[7 8 9]);
        if get(handles.chkRatFracAppr,'Value')==1
            set(handles.lsbPivotVectors,'String',num2str(rats(N(:,4:9))));
        else
            set(handles.lsbPivotVectors,'String',num2str(N(:,4:9)));
        end
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','on');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','off');
        set(handles.psbInfo,'Enable','off');
        set(handles.lsbPivotVectors,'Enable','inactive');
    else
        msgbox('No pivots defined yet.','Error','help','','','modal')
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end

function varargout = mnuDictSortn4_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    M=handles.MArray;
    if M~=0
        N=sortrows(M,[8 9]);
        if get(handles.chkRatFracAppr,'Value')==1
            set(handles.lsbPivotVectors,'String',num2str(rats(N(:,4:9))));
        else
            set(handles.lsbPivotVectors,'String',num2str(N(:,4:9)));
        end
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','on');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','off');
        set(handles.psbInfo,'Enable','off');
        set(handles.lsbPivotVectors,'Enable','inactive');
    else
        msgbox('No pivots defined yet.','Error','help','','','modal')
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end

function varargout = mnuDictSortn3_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    M=handles.MArray;
    if M~=0
        N=sortrows(M,9);
        if get(handles.chkRatFracAppr,'Value')==1
            set(handles.lsbPivotVectors,'String',num2str(rats(N(:,4:9))));
        else
            set(handles.lsbPivotVectors,'String',num2str(N(:,4:9)));
        end
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','on');
        set(handles.mnuDictSortUnsort,'Checked','off');
        set(handles.psbInfo,'Enable','off');
        set(handles.lsbPivotVectors,'Enable','inactive');
    else
        msgbox('No pivots defined yet.','Error','help','','','modal')
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end

function varargout = mnuDictSortUnsort_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    M=handles.MArray;
    if M~=0
        if get(handles.chkRatFracAppr,'Value')==1
           set(handles.lsbPivotVectors,'String',num2str(rats(M(:,4:9))));
        else
            set(handles.lsbPivotVectors,'String',num2str(M(:,4:9)));
        end
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','on');
        set(handles.psbInfo,'Enable','on');
        set(handles.lsbPivotVectors,'Enable','on');
    else
        msgbox('No pivots defined yet.','Error','help','','','modal')
    end
else
    msgbox('You shoulp press the Stop button first.','Error','help','','','modal')
end

% --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------


% --------------------------------------------------------------------
% ----------------- Rational fraction approximation ------------------
% --------------------------------------------------------------------
function varargout = chkRatFracAppr_Callback(h, eventdata, handles, varargin)
M=handles.MArray;
if norm(M,inf)~=0
    if get(handles.chkRatFracAppr,'Value')==1
        set(handles.mnuRatFracAppr,'Checked','on');
        set(handles.lsbPivotVectors,'String',num2str(rats(M(:,4:9))));
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','on');
        set(handles.lsbPivotVectors,'Enable','on');
    else
        set(handles.mnuRatFracAppr,'Checked','off');
        set(handles.lsbPivotVectors,'String',num2str(M(:,4:9)));
        set(handles.mnuDictSort4,'Checked','off');
        set(handles.mnuDictSort5,'Checked','off');
        set(handles.mnuDictSort6,'Checked','off');
        set(handles.mnuDictSortn5,'Checked','off');
        set(handles.mnuDictSortn4,'Checked','off');
        set(handles.mnuDictSortn3,'Checked','off');
        set(handles.mnuDictSortUnsort,'Checked','on');
        set(handles.lsbPivotVectors,'Enable','on');
    end
end


function varargout = mnuRatFracAppr_Callback(h, eventdata, handles, varargin)
menuvalue=get(handles.mnuRatFracAppr,'Checked');
if strcmp(menuvalue,'on')
    set(handles.mnuRatFracAppr,'Checked','off');
    set(handles.chkRatFracAppr,'Value',0);
else
    set(handles.mnuRatFracAppr,'Checked','on');
    set(handles.chkRatFracAppr,'Value',1);
end
chkRatFracAppr_Callback(h, eventdata, handles);

% --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------

%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    End View Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    Settings Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

% --------------------------------------------------------------------
% ---------------------- Set Initial Matrix --------------------------
% --------------------------------------------------------------------

function varargout = rdbSetInitialTwoVectors_Callback(h, eventdata, handles, varargin)
off1=handles.rdbSetInitialFourVectors;
off2=handles.rdbSetInitialabcdefgx;
mutual_exclude(off1);
mutual_exclude(off2);
off=handles.rdbSetInitialTwoVectors;
self_exclude(off);

function varargout = rdbSetInitialFourVectors_Callback(h, eventdata, handles, varargin)
off1=handles.rdbSetInitialTwoVectors;
off2=handles.rdbSetInitialabcdefgx;
mutual_exclude(off1);
mutual_exclude(off2);
off=handles.rdbSetInitialFourVectors;
self_exclude(off);

function varargout = rdbSetInitialabcdefgx_Callback(h, eventdata, handles, varargin)
off1=handles.rdbSetInitialTwoVectors;
off2=handles.rdbSetInitialFourVectors;
mutual_exclude(off1);
mutual_exclude(off2);
off=handles.rdbSetInitialabcdefgx;
self_exclude(off);

function varargout = psbSetInitial_Callback(h, eventdata, handles, varargin)
if handles.hPointer==0
    if get(handles.rdbSetInitialTwoVectors,'Value')==1
        prompt  = {'Enter first vector:','Enter second vector:'};
        title   = 'Set Initial Matrix...';
        lines= 1;
        def     = {'1 1 -1 1 0 1','1 1 -1 -1 0 -1'};
        answer  = inputdlg(prompt,title,lines,def);
        if ~isempty(answer)
            a=eval(['[' answer{1} ']']);
            b=eval(['[' answer{2} ']']);
            n=length(a)+length(b);
            A=cyclic_matrix_production(a,length(a));
            B=cyclic_matrix_production(b,length(b));
            W=[A B; -B' A'];
            if W*W'==(n-2)*eye(n) & n==2*length(a) & n==2*length(b)
                handles.WArray=0;
                handles.WArray=W;
                handles.diastasi=n;
                guidata(gcbo, handles);
                set(handles.mnuTwoVectors,'Checked','on');
                set(handles.mnuFourVectors,'Checked','off');
                set(handles.mnuAbcdefghxVariables,'Checked','off');
            else
                button=questdlg({'This is not a valid W(n-2,n)matrix.','You should check the element values'},'Error!','Ok','');
                if isempty(button) | button=='Ok'
                    psbSetInitial_Callback(h,eventdata,handles);
                end
            end
        elseif handles.WArray==0
            set(handles.mnuTwoVectors,'Checked','off');
            set(handles.mnuFourVectors,'Checked','off');
            set(handles.mnuAbcdefghxVariables,'Checked','off');
        end
    elseif get(handles.rdbSetInitialFourVectors,'Value')==1
        prompt  = {'Enter first vector:','Enter second vector:','Enter third vector:','Enter fourth vector:'};
        title   = 'Set Initial Matrix...';
        lines= 1;
        def     = {'1 1 -1','1 1 -1','0 1 1','0 1 1'};
        answer  = inputdlg(prompt,title,lines,def);
        if ~isempty(answer)
            a=eval(['[' answer{1} ']']);
            b=eval(['[' answer{2} ']']);
            c=eval(['[' answer{3} ']']);
            d=eval(['[' answer{4} ']']);
            n=length(a)+length(b)+length(c)+length(d);
            A=cyclic_matrix_production(a,length(a));
            B=cyclic_matrix_production(b,length(b));
            C=cyclic_matrix_production(c,length(c));
            D=cyclic_matrix_production(d,length(d));
            for i=1:length(a)-1
                r(i)=0;
            end
            r(i+1)=1;
            R=rev_cyclic_matrix_production(r,length(a));
            W=[A B*R C*R D*R; -B*R A D'*R -C'*R; -C*R -D'*R A B'*R; -D*R C'*R -B'*R A];
            if W*W'==(n-2)*eye(n) & n==4*length(a) & n==4*length(b) & n==4*length(c) & n==4*length(d)
                handles.WArray=0;
                handles.WArray=W;
                handles.diastasi=n;
                guidata(gcbo, handles);
                set(handles.mnuTwoVectors,'Checked','off');
                set(handles.mnuFourVectors,'Checked','on');
                set(handles.mnuAbcdefghxVariables,'Checked','off');
            else
                button=questdlg({'This is not a valid W(n-2,n)matrix.','You should check the element values'},'Error!','Ok','');
                if isempty(button) | button=='Ok'
                    psbSetInitial_Callback(h,eventdata,handles);
                end
            end
        elseif handles.WArray==0
            set(handles.mnuTwoVectors,'Checked','off');
            set(handles.mnuFourVectors,'Checked','off');
            set(handles.mnuAbcdefghxVariables,'Checked','off');
        end
    else
        B=multipliers;
        if ~isempty(B) 
            set(handles.mnuTwoVectors,'Checked','off');
            set(handles.mnuFourVectors,'Checked','off');
            set(handles.mnuAbcdefghxVariables,'Checked','on');
            handles.WArray=0;
            handles.WArray=B;
            handles.diastasi=16;
            guidata(gcbo, handles);
        end
        if handles.WArray==0
            set(handles.mnuTwoVectors,'Checked','off');
            set(handles.mnuFourVectors,'Checked','off');
            set(handles.mnuAbcdefghxVariables,'Checked','off');
        end
    end
else
    msgbox({'You should clear search data first. You can','do so by clicking:','','Edit >> Clear search data'},'Set Initial','help','','','modal');
end

function varargout = mnuSetInitialTwoVectors_Callback(h, eventdata, handles, varargin)
rdbSetInitialTwoVectors_Callback(h, eventdata, handles);
psbSetInitial_Callback(h, eventdata, handles);

function varargout = mnuSetInitialFourVectors_Callback(h, eventdata, handles, varargin)
rdbSetInitialFourVectors_Callback(h, eventdata, handles);
psbSetInitial_Callback(h, eventdata, handles);

function varargout = mnuSetInitialabcdefghx_Callback(h, eventdata, handles, varargin)
rdbSetInitialabcdefgx_Callback(h, eventdata, handles);
psbSetInitial_Callback(h, eventdata, handles);

% --------------------------------------------------------------------
% -------------------- End -------------------------------------------
% --------------------------------------------------------------------



% --------------------------------------------------------------------
% ----------------- Search Pivot Method ------------------------------
% --------------------------------------------------------------------

function varargout = mnuFindMaxColumn_Callback(h, eventdata, handles, varargin)
set(handles.rdbFindMaxColumn,'Value',~get(handles.rdbFindMaxColumn,'Value'));
rdbFindMaxColumn_Callback(h, eventdata, handles);

function varargout = rdbFindMaxColumn_Callback(h, eventdata, handles, varargin)
if handles.MArray==0
    off1=handles.rdbFindMaxRow;
    off2=handles.rdbFindRandMax;
    mutual_exclude(off1);
    mutual_exclude(off2);
    off=handles.rdbFindMaxColumn;
    self_exclude(off);
    set(handles.mnuFindMaxColumn,'Checked','on');
    set(handles.mnuFindMaxRow,'Checked','off');
    set(handles.mnuFindRandMax,'Checked','off');
    handles.GaussOlikiMethod=1;
    guidata(gcbo,handles);
    set(handles.txtSearchPivotMethod,'String','1');
else
    set(handles.rdbFindMaxColumn,'Value',~get(handles.rdbFindMaxColumn,'Value'));
    msgbox({'You should clear search data first. You can','do so by clicking:','','Edit >> Clear search data'},'Find max indices method','help','','','modal');
end


function varargout = mnuFindMaxRow_Callback(h, eventdata, handles, varargin)
set(handles.rdbFindMaxRow,'Value',~get(handles.rdbFindMaxRow,'Value'));
rdbFindMaxRow_Callback(h, eventdata, handles);

function varargout = rdbFindMaxRow_Callback(h, eventdata, handles, varargin)
if handles.MArray==0
    off1=handles.rdbFindMaxColumn;
    off2=handles.rdbFindRandMax;
    mutual_exclude(off1);
    mutual_exclude(off2);
    off=handles.rdbFindMaxRow;
    self_exclude(off);
    set(handles.mnuFindMaxColumn,'Checked','off');
    set(handles.mnuFindMaxRow,'Checked','on');
    set(handles.mnuFindRandMax,'Checked','off');
    handles.GaussOlikiMethod=2;
    guidata(gcbo,handles);
    set(handles.txtSearchPivotMethod,'String','2');
else
    set(handles.rdbFindMaxRow,'Value',~get(handles.rdbFindMaxRow,'Value'));
    msgbox({'You should clear search data first. You can','do so by clicking:','','Edit >> Clear search data'},'Find max indices method','help','','','modal');
end

function varargout = mnuFindRandMax_Callback(h, eventdata, handles, varargin)
set(handles.rdbFindRandMax,'Value',~get(handles.rdbFindRandMax,'Value'));
rdbFindRandMax_Callback(h, eventdata, handles);

function varargout = rdbFindRandMax_Callback(h, eventdata, handles, varargin)
if handles.MArray==0
    off1=handles.rdbFindMaxColumn;
    off2=handles.rdbFindMaxRow;
    mutual_exclude(off1);
    mutual_exclude(off2);
    off=handles.rdbFindRandMax;
    self_exclude(off);
    set(handles.mnuFindMaxColumn,'Checked','off');
    set(handles.mnuFindMaxRow,'Checked','off');
    set(handles.mnuFindRandMax,'Checked','on');
    handles.GaussOlikiMethod=3;
    guidata(gcbo,handles);
    set(handles.txtSearchPivotMethod,'String','3');
else
    set(handles.rdbFindRandMax,'Value',~get(handles.rdbFindRandMax,'Value'));
    msgbox({'You should clear search data first. You can','do so by clicking:','','Edit >> Clear search data'},'Find max indices method','help','','','modal');
end

% --------------------------------------------------------------------
% ---------------------- End -----------------------------------------
% --------------------------------------------------------------------




% --------------------------------------------------------------------
% --------------- Row And Column Permutation -------------------------
% --------------------------------------------------------------------
function varargout = slider1_Callback(h, eventdata, handles, varargin)
val=get(handles.slider1,'Value');
set(handles.edtMaxRowSwaps,'String', num2str(round(val)));
set(handles.txtMaximumRowPermutations,'String', num2str(round(val)));
handles.mae_grammwn=round(val);
guidata(gcbo,handles);

function varargout = slider2_Callback(h, eventdata, handles, varargin)
val=get(handles.slider2,'Value');
set(handles.edtMaxColumnSwaps,'String', num2str(round(val)));
set(handles.txtMaximumColumnPermutations,'String', num2str(round(val)));
handles.mae_stilwn=round(val);
guidata(gcbo,handles);

function varargout = edtMaxRowSwaps_Callback(h, eventdata, handles, varargin)
val = str2num(get(handles.edtMaxRowSwaps,'String'));
set(handles.slider1,'Value',val);
handles.mae_grammwn=round(val);
guidata(gcbo,handles);

function varargout = edtMaxColumnSwaps_Callback(h, eventdata, handles, varargin)
val = str2num(get(handles.edtMaxColumnSwaps,'String'));
set(handles.slider2,'Value',val);
handles.mae_stilwn=round(val);
guidata(gcbo,handles);

function varargout = mnuRowAndColumnPermutation_Callback(h, eventdata, handles, varargin)
a=get(handles.slider1,'Value');
b=get(handles.slider2,'Value');
pos_size=get(handles.fgrMain,'Position');
rowcoldlg_pos=[pos_size(1)+pos_size(3)/3 pos_size(2)+pos_size(4)/3];
[grm,stil]=rowcolperm(a,b,rowcoldlg_pos);
set(handles.slider1,'Value',grm);
set(handles.slider2,'Value',stil);
guidata(gcbo,handles);
slider1_Callback(h,eventdata,handles,varargin);
drawnow;
slider2_Callback(h,eventdata,handles,varargin);

% --------------------------------------------------------------------
% ----------------------------- End ----------------------------------
% --------------------------------------------------------------------

% --------------------------------------------------------------------
% --------------- Row And Column Multiplication by -1 ----------------
% --------------------------------------------------------------------
% --------------------------------------------------------------------
function varargout = sldMinusRowMults_Callback(h, eventdata, handles, varargin)
val_backup=handles.minus_row_mult;
val=get(handles.sldMinusRowMults,'Value');
if round(val)<=handles.diastasi
    set(handles.edtMinusRowMults,'String', num2str(round(val)));
    set(handles.txtMinusRowMults,'String', num2str(round(val)));
    handles.minus_row_mult=round(val);
    guidata(gcbo,handles);
else
    set(handles.edtMinusRowMults,'String', num2str(round(val_backup)));
    set(handles.txtMinusRowMults,'String', num2str(round(val_backup)));
    set(handles.sldMinusRowMults,'Value', round(val_backup));
    msgbox('Value can not exceed matrix dimensions','Error','help','','','modal')
end
% --------------------------------------------------------------------
function varargout = sldMinusColumnMults_Callback(h, eventdata, handles, varargin)
val_backup=handles.minus_column_mult;
val=get(handles.sldMinusColumnMults,'Value');
if round(val)<=handles.diastasi
    set(handles.edtMinusColumnMults,'String', num2str(round(val)));
    set(handles.txtMinusColumnMults,'String', num2str(round(val)));
    handles.minus_column_mult=round(val);
    guidata(gcbo,handles);
else
    set(handles.edtMinusColumnMults,'String', num2str(round(val_backup)));
    set(handles.txtMinusColumnMults,'String', num2str(round(val_backup)));
    set(handles.sldMinusColumnMults,'Value', round(val_backup));
    msgbox('Value can not exceed matrix dimensions','Error','help','','','modal')
end

% --------------------------------------------------------------------
function varargout = edtMinusRowMults_Callback(h, eventdata, handles, varargin)
val = str2num(get(handles.edtMinusRowMults,'String'));
set(handles.sldMinusRowMults,'Value',val);
handles.minus_row_mult=round(val);
guidata(gcbo,handles);


% --------------------------------------------------------------------
function varargout = edtMinusColumnMults_Callback(h, eventdata, handles, varargin)
val = str2num(get(handles.edtMinusColumnMults,'String'));
set(handles.sldMinusColumnMults,'Value',val);
handles.minus_column_mult=round(val);
guidata(gcbo,handles);

function varargout = mnuMinusRowColMult_Callback(h, eventdata, handles, varargin)
a=get(handles.sldMinusRowMults,'Value');
b=get(handles.sldMinusColumnMults,'Value');
pos_size=get(handles.fgrMain,'Position');
rowcoldlg_pos=[pos_size(1)+pos_size(3)/3 pos_size(2)+pos_size(4)/3];
[grm,stil]=rowcolmult(a,b,rowcoldlg_pos);
set(handles.sldMinusRowMults,'Value',grm);
set(handles.sldMinusColumnMults,'Value',stil);
guidata(gcbo,handles);
sldMinusRowMults_Callback(h,eventdata,handles,varargin);
drawnow;
sldMinusColumnMults_Callback(h,eventdata,handles,varargin);

% --------------------------------------------------------------------
% ----------------------------- End ----------------------------------
% --------------------------------------------------------------------

% --------------------------------------------------------------------
% --------------- Maximum Equivalents --------------------------------
% --------------------------------------------------------------------

function varargout = ckbSetMaxEquivalents_Callback(h, eventdata, handles, varargin)
if get(handles.ckbSetMaxEquivalents,'Value')==1
    handles.epan=handles.epan_backup;
    guidata(gcbo,handles);
    set(handles.edit3,'Enable','on');
    set(handles.edit3,'String',handles.epan);
    set(handles.text9,'Enable','on');
    set(handles.text10,'Enable','on');
    set(handles.edtTimeLeft,'Enable','on');
    set(handles.text15,'Enable','on');
else
    set(handles.edit3,'Enable','off');
    set(handles.text9,'Enable','off');
    set(handles.text10,'Enable','off');
    set(handles.edtTimeLeft,'Enable','off');
    set(handles.text15,'Enable','off');
    handles.epan_backup=handles.epan;
    handles.epan=0;
    guidata(gcbo,handles);
end


function varargout = edit3_Callback(h, eventdata, handles, varargin)
handles.epan=eval(get(handles.edit3,'String'));
guidata(gcbo,handles);


function varargout = mnuMaximumEquivalents_Callback(h, eventdata, handles, varargin)
if ~strcmp(get(handles.tgbStart,'String'),'Stop')
    if strcmp(get(handles.mnuMaximumEquivalents,'Checked'),'off')
        prompt  = 'Enter maximum number of equivalent matrices:';
        title   = 'Set Maximum Equivalents...';
        lines= 1;
        def     = {int2str(handles.epan_backup)};
        answer  = inputdlg(prompt,title,lines,def);
        if ~isempty(answer)
            set(handles.ckbSetMaxEquivalents,'Value',1);
            ckbSetMaxEquivalents_Callback(h, eventdata, handles);
            set(handles.edit3,'String',eval(answer{1}));
            edit3_Callback(h, eventdata, handles);
            set(handles.mnuMaximumEquivalents,'Checked','on');
            set(handles.txtMaximumEquivalents,'String',num2str(eval(answer{1})));
        end
    else
        set(handles.ckbSetMaxEquivalents,'Value',0);
        ckbSetMaxEquivalents_Callback(h, eventdata, handles);
        set(handles.mnuMaximumEquivalents,'Checked','off');
        set(handles.txtMaximumEquivalents,'String','-');
    end
else
    msgbox('You shoulp press the Stop button first','Error','help','','','modal')
end
% --------------------------------------------------------------------
% ------------------------ End ---------------------------------------
% --------------------------------------------------------------------
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    End Settings Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    Help Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

function varargout = mnuGTMHelp_Callback(h, eventdata, handles, varargin)
msgbox('Sorry, no help available at the moment.','GTMHelp','help','','','modal')

function varargout = mnuAbout_Callback(h, eventdata, handles, varargin)
msgbox({'This software was developed during' 'an undergraduate course in Numerical', 'Linear Algebra by M. Mitrouli.','Univ. of Athens, Dept. of Mathematics.',...
        'Free use for academic purposes only, with','prior written permission of the authors','','Authors:', 'Zaganas Adonis  2002, ', 'Tzachristas Stefanos.','','e-mail: a_zaganas@yahoo.com'}, ...
        'About','help','','','modal')


%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    End Help Menu    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@







Contact us at files@mathworks.com