function outInfo=econtinfo
% CONTINFO used by the MATLAB Tour to get name lists 

%    Yama Habibzai
%    Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%    $Revision: 1.17 $  $Date: 1998/10/16 23:08:52 $ 

%  Control Design Segment

n = 1;

% Flag to show if a Toolbox is installed. Initially, assume none are installed
control =0;
simulink= 0;
sysid= 0;
freqid =0;
qft= 0;
fuzzy= 0;
nnet= 0;
mu= 0;
robust= 0;
mpc = 0;
ncd= 0;
fixpoint= 0;
rtw= 0;

figs = allchild(0);
figNumber = findobj(figs, 'Name', 'MATLAB Tour');
param = get(figNumber, 'UserData');
blocksets = param.blocksets;
toolboxes = param.toolboxes;

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, 'Control System')
    n = n+1;
    control =1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on The Control System Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''control''))';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name =['   ', toolboxes(i).Name];
  end % 
end

% ------ 
simExist = exist('siminfo.m');
if simExist
  n = n+1; 
  simulink = 1;
  tbxList(n).Name = '   SIMULINK';
  simdemos = siminfo;
  sizsimu = size(simdemos);
  
  % Combine the NEW, Simple and Complex examples together ...
  
  % THE SIMPLE
  for i = 1:sizsimu(1,2);
    if strcmp(simdemos(i).Name, 'Simple models')
      tbxList(n).Help = simdemos(i).Help;
      tbxList(n).DemoList = simdemos(i).DemoList;
      tbxList(n).FcnList = simdemos(i).FcnList;
      sizelist = size(tbxList(n).DemoList);
    end
  end
  
  % THE NEW
  for i = 1:sizsimu(1,2);
    if strcmp(simdemos(i).Name, 'New in Simulink 2')
      sizenew = size(simdemos(i).DemoList);
      for j = 1:sizenew(1,1)
          tbxList(n).DemoList{sizelist(1,1)+j, 1} = char(simdemos(i).DemoList(j,1));
          tbxList(n).FcnList{sizelist(1,1)+j, 1} = char(simdemos(i).FcnList(j,1));
          newsize = size(tbxList(n).DemoList);
      end
    end
  end
  
  
  
  % THE COMPLEX
  for i = 1:sizsimu(1,2)
    if strcmp(simdemos(i).Name, 'Complex models')
      sizecomplex = size(simdemos(i).DemoList);
      for k = 1:sizecomplex(1,1)
          tbxList(n).DemoList{newsize(1,1)+k, 1} = char(simdemos(i).DemoList(k,1));
          tbxList(n).FcnList{newsize(1,1)+k, 1} = char(simdemos(i).FcnList(k,1));
      end
    end
  end
  sizelist = size(tbxList(n).DemoList);
  tbxList(n).DemoList{sizelist(1,1)+1, 1} = 'More on SIMULINK';
  tbxList(n).FcnList{sizelist(1,1)+1, 1} =  'evalcb(''toolInfo'')';
  tbxList(n).Help= about('simulink');
end


%---------------
for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'System Identification')
    n = n +1;
    sysid = 1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on System Identification Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''ident''))';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name = ['   'toolboxes(i).Name];
  end
end
% *******
for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'LMI Control')
    n = n+1;
    lmi = 1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on LMI Control Toolbox' ;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''lmilab''))';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name =['   ', toolboxes(i).Name];
  end
end
 
%*************

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Frequency Domain System Identification')
    n = n+1;
    freqid = 1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on Frequency Domain System Identification';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''fdident''))';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name =['   ', toolboxes(i).Name];
  end
end
%*************
for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'QFT Control Design')
    n = n+1;
    qft =1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on QFT';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''qft''))';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name = ['   ',toolboxes(i).Name];
  end
end

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

% *******

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

% *******

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Mu-Analysis and Synthesis')
    n = n +1;
    mu = 1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on Mu-Analysis and Synthesis';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name = ['   ',toolboxes(i).Name];
  end
end
% *******
for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Robust Control')
    n = n +1;
    robust = 1;  
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the Robust Control Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''robust''))';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name =['   ', toolboxes(i).Name];
  end
end
% *******

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'MPC Tools')
    n = n+1;
    mpc = 1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on The Model Predictive Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name = ['   ',toolboxes(i).Name];
  end
end

% *******
for i = 1:size(blocksets, 2);
  if  strcmp(blocksets(i).Name, 'Nonlinear Control Design')
    n = n+1;
    ncd =1;
    tbxList(n).DemoList = blocksets(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the NCD Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = blocksets(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''ncd''))';
    tbxList(n).Help = blocksets(i).Help;
    tbxList(n).Name = ['   ',blocksets(i).Name];
 end
end
% *******

for i = 1:size(blocksets, 2);
  if  strcmp(blocksets(i).Name, 'Fixed Point')
    n = n+1;
    fixpoint = 1;
    tbxList(n).DemoList = blocksets(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on Fixed Point Blockset';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Blockset';
    tbxList(n).FcnList = blocksets(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''fixpoint''))';
    tbxList(n).Help = blocksets(i).Help;
    tbxList(n).Name = ['   ',blocksets(i).Name];
  end
end

% -----

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'RTW')
    n = n +1;
    rtw =1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the Real-Time Workshop';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name = ['   ',toolboxes(i).Name];
  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 control == 0
  n = n+1;
  tbxList(n).DemoList={'More on The Control System Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'cont_con'};
  tbxList(n).Help= about('control');
  tbxList(n).Name= ['   ','Control System'];
end

if simulink== 0
  n = n+1;
  tbxList(n).DemoList={'More on SIMULINK'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'};
  tbxList(n).Help= about('simulinknew');
  tbxList(n).Name=['   ','SIMULINK'];
end

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

if lmi== 0
  n = n+1;
  tbxList(n).DemoList={'More on LMI Control Toolbox'
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'
  'lmi_con'};
  tbxList(n).Help= about('lmi');
  tbxList(n).Name=['   ','LMI Control Toolbox'];
end
 
if freqid == 0
  n = n+1;
  tbxList(n).DemoList={'More on Frequency Domain System Identification'
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'
  'fid_con'};
  tbxList(n).Help= about('freqid');
  tbxList(n).Name=['   ','Frequency Domain System Identification'];
 
end
 
if qft== 0
  n = n+1;
  tbxList(n).DemoList={'More on QFT Control Design'
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'
  'qft_con'};
  tbxList(n).Help= about('qft');
  tbxList(n).Name=['   ','QFT Control Design'];
end

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 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 mu== 0;
  n = n+1;
  tbxList(n).DemoList={'More on Mu-Analysis and Synthesis Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'
  'mu_con'};
  tbxList(n).Help= about('mu');
  tbxList(n).Name=['   ','Mu-Analysis & Synthesis'];
end

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

if mpc== 0
  n = n+1;
  tbxList(n).DemoList={'More on The Model Predictive Toolbox'
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'
  'mpc_con'};
  tbxList(n).Help= about('modelpredict');
  tbxList(n).Name=['   ','Model Predictive Toolbox'];
end

if ncd== 0
  n = n+1;
  tbxList(n).DemoList={'More on the NCD Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'ncd_con'};
  tbxList(n).Help = about('ncd');
  tbxList(n).Name=['   ','Nonlinear Control Design'];
end

if fixpoint== 0
  n = n+1;
  tbxList(n).DemoList={'More on Fixed Point Blockset'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'};
  tbxList(n).Help= about('fixpoint');
  tbxList(n).Name=['   ','Fixed Point Blockset'];
end

if rtw== 0
  n = n+1;
  tbxList(n).DemoList={'More on the Real-Time Workshop'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'};
  tbxList(n).Help= about('rtw');
  tbxList(n).Name=['   ','Real-Time Workshop'];
end

outInfo = tbxList;



