MATLAB: How to change transfer function in hidden layer

hidden layersneural networktanhtansigtransfer function

hello everyone,as we know the default transfer function in hidden layer is tansig, if I want to change the transfer function to tanh, which is not in the selection of transfer functions, I use the command:
net.layers{1}.transferFcn = 'tanh'
which is not workable and shows error. Can anyone help me to solve this by using tanh as my transfer function.

Best Answer

PLEASE DO NOT POST NEURAL NETWORK QUESTIONS IN BOTH THE NEWSGROUP AND ANSWERS.