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

% Copyright 1992-2000 The MathWorks, Inc.
% $Revision: 1.15 $  $Date: 2000/06/15 04:16:09 $

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

  slide(1).code={
   'slideData=nnslides(''start'',slideData,''Spurious Stable Points'');',
   '' };
  slide(1).text={
   'NEWHOP  - Creates a Hopfield network.',
   'SIM   - Simulates a neural  network.',
   '',
   'A Hopfield network with five neurons is designed to have four stable equilibria.  However, unavoidably, it has other undesired equilibria.',
   ''};

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

  slide(2).code={
   'slideData=nnslides(''text'',slideData,'''');',
   'T = [+1 +1 -1 +1; -1 +1 +1 -1; -1 -1 -1 +1; +1 +1 +1 +1; -1 -1 +1 +1];' };
  slide(2).text={
   'We would like to obtain a Hopfield network that has the four stable points defined by the two target (column) vectors in T.',
   '>> T = [+1 +1 -1 +1;',
   '           -1 +1 +1 -1;',
   '           -1 -1 -1 +1;',
   '           +1 +1 +1 +1;',
   '           -1 -1 +1 +1];',
   '',
   ''};

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

  slide(3).code={
   'net=newhop(T);',
   'slideData=nnslides(''text'',slideData,'''');' };
  slide(3).text={
   'The function NEWHOP creates Hopfield networks given the stable points T.',
   '',
   '>> net=newhop(T);'};

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

  slide(4).code={
   'format bank;',
   'P = {rands(5,4)};',
   'for yy=1:30',
   '[Y,Pf,Af] = sim(net,{4 1},{},P);'
   'a=evalc(''Y{1}'');',
   'slideData=nnslides(''text'',slideData,a);',
   'P=Y;',
   'end;' };
  slide(4).text={
   'Here we define 4 random starting points and simulate the Hopfield network for 50 steps.',
   '>> format bank;',
   '>> P = rands(5,4);',
   '>> [Y,Pf,Af] = sim(net,{4 50},{},P);',
   '>> Y{1}',
   'Some initial conditions will lead to desired stable points. Others will lead to undesired stable points.  To see another run, click "Previous" then "Next" to revisit this slide.',
   '',
   ''};
end