function slide=demorb4
% This is a slideshow file for use with playshow.m and makeshow.m
% To see it run, type 'playshow demorb4', 

% Copyright (c) 1992-1998 by The MathWorks, Inc.
% $Revision: 1.11 $  $Date: 1998/09/03 22:29:58 $

if nargout<1,
  playshow demorb4
else
  %========== Slide 1 ==========

  slide(1).code={
   'slideData=nnslides(''start'',slideData,''Overlapping Neurons'');' };
  slide(1).text={
   'NEWRB  - Creates a radial basis network.',
   'SIM  - Simulates a neural network.',
   '',
   'Using the above functions a radial basis network is trained to respond to specific inputs with target outputs. However, because the spread of the radial basis neurons is too high, each neuron responds essentially the same, and the network cannot be designed.',
   '',
   ''};

  %========== Slide 2 ==========

  slide(2).code={
   'slideData=nnslides(''axes'',slideData);',
   'P = -1:.1:1;',
   'T = [-.9602 -.5770 -.0729  .3771  .6405  .6600  .4609   .1336 -.2013 -.4344 -.5000 -.3930 -.1647  .0988  .3072  .3960  .3449  .1816 -.0312 -.2189 -.3201];',
   'plot(P,T,''+'');',
   'title(''Training Vectors'');',
   '  xlabel(''Input Vector P'');',
   '  ylabel(''Target Vector T'');' };
  slide(2).text={
   'Define 21 inputs P and associated targets T:',
   '>> P = -1:.1:1;',
   '>> T = [-.9602 -.5770 -.0729  .3771  .6405  .6600  .4609 ...',
   '          .1336 -.2013 -.4344 -.5000 -.3930 -.1647  .0988 ...',
   '          .3072  .3960  .3449  .1816 -.0312 -.2189 -.3201];',
   'Plot these 21 data points:',
   '>> plot(P,T,''+'');'};

  %========== Slide 3 ==========

  slide(3).code={
   'more off;',
   'plot(P,T,''+'');',
   'title(''Training Vectors'');',
   'xlabel(''Input Vector P'');',
   'ylabel(''Target Vector T'');',
   'eg = 0.02; % sum-squared error goal.',
   'sc = 100;    % spread constant radial basis functions.',
   'warnstate=warning;',
	'warning off',
   'net=newrb(P,T,eg,sc);',
   'warning(warnstate)',
   '' };
  slide(3).text={
   'The function NEWRB quickly creates a radial basis network which approximates the function defined by P and T.',
   '',
   'In addition to the training set and targets, NEWRB takes two arguments:',
   '>> eg = 0.02;  % sum-squared error goal',
   '>> sc = 100;       % spread constant',
   'The spread of the radial basis neurons B is set to a very large number.',
   '>> net=newrb(P,T,eg,sc);'};

  %========== Slide 4 ==========

slide(4).code={
   'Y=sim(net,P);',
   'hold on;',
   'plot(P,Y);',
   'hold off;',
   '' };
  slide(4).text={
   'NEWRB cannot properly design a radial basis network due to the large overlap of the input regions of the radial basis neurons.  All the neurons always output 1, and so cannot be used to generate different responses. To see how the network performs with the training set, simulate the network with the original inputs:',
   '>> Y=sim(net,P);',
   'And plot the results on the same graph as the training set:',
   '>> hold on;  plot(P,Y);  hold off;',
   ''};
end