206 CHAPTER 6. NEURAL CONTROL
p(i)=(exp(-time))*sin(w*time);
time=time+0.1;
if (p(i)>0.0)
t(i)=1;
elseif (p(i)<0.0)
t(i)=-1;
end
endFigure 6.3 illustrates the damped sinusoid generated from the precedingMat-
labcode.
Figure 6.3. Damped sinusoidal pattern for neural network trainingFigure 6.4 illustrates the relay characteristic obtained by plotting the pattern
vectorp(i)versus the targett(i). The neural network will be trained to repro-
duce this relay characteristic.
-1-0 .6 -0 .4 -0 .2 0 0.2 0.4 0.6 0.8-0 .8-0 .6-0 .4-0 .200.20.40.60.81Figure 6.4. Plot of pattern vector versus target that represents a relay
characteristicIn our example, a two-layer feedforward network is created. The topology
of the network will comprise a hidden layer with some specified number of
neurons, and an output layer with as many neurons as we desire to represent