You are on page 1of 1

%Here input x and targets t define a simple function that you can plot:

x = [14 25 29 39 14 27 33 13 17 38];
y = [48.481 36.016 33.909 36.386 45.199 51.669 29.645 43.011 59.233 37.084]
z = [4 4 4 4 3 6 3 2 2 4]
t = [52.35040736 51.29715226 51.14982028 51.323941 52.0429496 52.66968556
50.87882603 51.84994612 53.50854829 51.37522306];
plot (x,y,z,t,'o')
%Here feedforwardnet creates a two-layer feed-forward network. The network has one hidden layer with
ten neurons
net = feedforwardnet(10);
net = configure(net,x,y,z,t);
y1 = net(x,y,z)
plot(x,y,z,t,'o',x,y,z,y1,'x')
%The network is trained and then resimulated.
net = train(net,x,y,z,t);
y2 = net(x,y,z)
plot(x,t,'o',x,y,z,y1,'x',x,y,z,y2,'*')

You might also like