function outInfo=emathinfo
%EMATHINFO helper function for keeping list data.
%          It looks for all math related Toolboxes
%          and lists them, adding some of its own 
%          information to each Toolbox.

%    Yama Habibzai
%    Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%    $Revision: 1.18 $  $Date: 1998/08/19 19:33:54 $ 

% Flag to show if a Toolbox is installed. Initially, assume none are installed
 
fuzzy= 0;
compiler= 0;
cmath= 0;
cmathplus=0;
nag= 0;
nnet= 0;
pde= 0;
spline= 0;
stats= 0;
symbolic= 0;
wavelets= 0;

mathdemos = matinfo;

param = get(gcf, 'userdata');
toolboxes = param.toolboxes;
siz = size(mathdemos);

n = 1;
% *******************
tbxList(n).DemoList = {' '
' '
'   Select a subcategory from'
'   the left for MATLAB demos'};

tbxList(n).Name = 'MATLAB';
tbxList(n).FcnList = ' ';
List(n).Help = ' ';
% *******************

for i = 1:siz(1,2)
  if strcmp(mathdemos(i).Name, 'Matrices')
    n= n+1;
    tbxList(n).Name = ['   ','Matrix Demos'];
    tbxList(n).Help = mathdemos(i).Help;
    tbxList(n).DemoList = mathdemos(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 1)+1} = 'More on MATLAB Matrices' ;
    tbxList(n).FcnList = mathdemos(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 1)+1} = 'evalcb(''toolInfo'')';
  end
end

for i = 1:siz(1,2)
  if strcmp(mathdemos(i).Name,  'Numerics')
    n = n+1;
    tbxList(n).Name = ['   ','Numerical Demos'];
    tbxList(n).Help = mathdemos(i).Help;
    tbxList(n).DemoList = mathdemos(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 1)+1} = 'More on MATLAB Numerics' ;
    tbxList(n).FcnList = mathdemos(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 1)+1} = 'evalcb(''toolInfo'')';
  end
end

% *******************
%   Blank space
n  = n+1;
tbxList(n).DemoList = ' ';
tbxList(n).Name = ' ';
tbxList(n).FcnList = ' ';
tbxList(n).Help = ' ';
% *******************

%%%%%%% START OF TOOLBOX LIST %%%%%
n = n+1;
tbxList(n).DemoList = {' '
' '
'  The products on the left are'
'  installed on your system and'
'  have demos available.'};

tbxList(n).Name = 'Products installed with demos:';
tbxList(n).FcnList = ' ';
tbxList(n).Help = ' ';

%%%%%%% INSTALLED TOOLBOXES %%%%%%%%

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'MATLAB C Math Library')
    n = n+1;
    cmath = 1; 
    tbxList(n).Name = ['   ', toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the MATLAB C Math Library';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
  end
end

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'MATLAB C++ Math Library')
    n = n+1;
    cmath = 1;
    tbxList(n).Name = ['   ', toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the MATLAB C++ Math Library';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
  end
end

% ---------
for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Compiler')
    n = n+1;
    compiler = 1;
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the MATLAB Compiler';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+2} = 'Compiler details';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+2} = 'compiler';
  end
end

% ---------
for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Fuzzy Logic')
    n = n+1;
    fuzzy = 1; 
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on Fuzzy Logic';
     tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''fuzzy''))';
  end
end
%--------------

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Neural Networks')
    n = n+1;
    nnet = 1;
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;

    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on Neural Networks';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''nnet''))';
  end
end

%--------------

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Statistics')
    n = n+1;
    stats = 1;
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the Statistics Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''stats''))';
  end
end
%--------------

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Symbolic Math')
    n = n+1;
    symbolic =1;
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the Symbolic Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''symbolic''))';
  end
end

%--------------
for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Partial Differential Equation')
    n = n+1;
    pde = 1;
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the PDE Toolbox';
    mathhList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''pde''))';
  end
end

%--------------

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'NAG')
    n = n+1;
    nag = 1;
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the NAG Toolbox';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
  end
end

%--------------

for i = 1:size(toolboxes, 2);
 if  strcmp(toolboxes(i).Name, 'Spline')
   n = n+1;
   spline = 1;
   tbxList(n).Name = ['   'toolboxes(i).Name];
   tbxList(n).Help = toolboxes(i).Help;
   tbxList(n).DemoList = toolboxes(i).DemoList;
   tbxList(n).FcnList = toolboxes(i).FcnList;
   tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the Spline Toolbox';
   tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
   tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
   tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''splines''))';
 end
end

%--------------

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Wavelet')
    n = n+1;
    wavelets = 1;
    tbxList(n).Name = ['   'toolboxes(i).Name];
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the Wavelet Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
   tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''wavelet''))';
  end
end

% *******************
%   Blank space
n  = n+1;
tbxList(n).DemoList = ' ';
tbxList(n).Name = ' ';
tbxList(n).FcnList = ' ';
tbxList(n).Help = ' ';
% *******************

%%%%%%%% TOOLBOXES NOT INSTALLED %%%%%%%%%%
n = n+1;
tbxList(n).DemoList = {' '
' '
'  The MATLAB Tour could not find'
'  demos for these products on your'
'  system.'
' '
'  However, information for these'
'  products is provided.'
' '};

tbxList(n).Name = 'Information only:';
tbxList(n).FcnList = ' ';
tbxList(n).Help = ' ';
% *******************

if fuzzy== 0
  n = n+1;

  tbxList(n).DemoList={'More on  Fuzzy Logic Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'fuz_con'};
  tbxList(n).Help= about('fuzzy');

  tbxList(n).Name=['   ','Fuzzy Logic'];

end

if compiler== 0
  n = n+1;
  tbxList(n).DemoList={'More on the MATLAB Compiler',
  'Compiler details',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'compdem',
  'comp_con'};
  tbxList(n).Help= about('compiler');
  tbxList(n).Name=['   ','MATLAB Compiler'];
end

if cmath == 0
  n = n+1;
  tbxList(n).DemoList={'More on The MATLAB C Math Library'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'};
  tbxList(n).Help= about('cmath');
  tbxList(n).Name=['   ','MATLAB C Math Library'];

end


if cmathplus == 0
  n = n+1;
  tbxList(n).DemoList={'More on The MATLAB C++ Math Library',
    'C++ Math Library details'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
    'cplusdmo'};
  tbxList(n).Help= about('cplus');
  tbxList(n).Name=['   ','MATLAB C++ Math Library'];
 
end

if nag == 0
  n = n+1;

  tbxList(n).DemoList={'More on The NAG Foundation Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'nag_con'};
  tbxList(n).Help= about('nag');
  tbxList(n).Name= ['   ','NAG Foundation'];

end


if nnet== 0
  n = n+1;
  tbxList(n).DemoList={'More on Neural Network Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'nnt_con'};
  tbxList(n).Help= about('nnet');
  tbxList(n).Name=['   ','Neural Networks'];
 
end

if pde== 0
  n = n+1;
  tbxList(n).DemoList={'More on the PDE Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'pde_con'};
  tbxList(n).Help= about('pde');
  tbxList(n).Name=['   ','Partial Differential Equation Toolbox'];
end

if spline== 0
  n = n+1;
  tbxList(n).DemoList={'More on the Spline Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'spl_con'};
  tbxList(n).Help= about('spline');
  tbxList(n).Name=['   ','Spline'];
end

if stats== 0
  n = n+1;
  tbxList(n).DemoList={'More on the Statistics Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'stat_con'};
  tbxList(n).Help= about('stats');
  tbxList(n).Name=['   ','Statistics'];
end

if symbolic== 0
  n = n+1;
  tbxList(n).DemoList={'More on the Symbolic Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'sym_con'};
  tbxList(n).Help= about('symbolic');
  tbxList(n).Name=['   ','Symbolic Math'];
end

if wavelets== 0
  n = n+1;
  tbxList(n).DemoList={'More on The Wavelet Toolbox'
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'wav_con'};
  tbxList(n).Help= about('wavelets');
  tbxList(n).Name=['   ','Wavelets Toolbox'];
end


outInfo=tbxList;



