Step 2:
clear;
clc;
close all;
mynetwork=feedforwardnet([7,7]);
New steps are shown in green.
Now lets change the activation functions of the hidden and output layers to what was asked in the question.
mynetwork.layers{1:2}.transferFcn=
'logsig'; % logistic activation function for the hidden layers
(These are layers 1 and 2 of network. By convention the input layer
is not counted since it doesn't have activation functions)
Note: alternatively, we could have done this one layer at a time, for example, mynetwork.layers{1}.transferFcn= 'logsig'; for the first hidden layer and mynetwork.layers{2}.transferFcn= 'logsig'; for the second hidden layer.
Now set the activation function for the output layer (this is layer 3 of the network)
mynetwork.layers{3}.transferFcn= 'tansig'; % tangent activation function for the output layer
Check
to see if the activation functions have been changed. For
example, to see if the activation function of the third layer (output
layer) has been changed from "purelin" (default) to "tansig" type the following
in the command window and hit return (remember that you have to run
your program first so that it creates the network before you can check
its parameters)::
mynetwork.layers{3}.transferFcn