MATLAB: How to extract the transfer equation from matlab for complete neural network

equationneural networkstansig

Hello,
I have used NNA toolbox in MatLab and created neural network with two layers. First layer (with three neurons) uses tansig, and secon layer (with one neuorn) pureline transfer function. So, my transfer equation for the complete NN should look like this:
O=pureline(W2*tansig(W1i*Xi+B1)+B2)
Where O – represents the output, W2-weight vector of the second layer neuron, B2 – bias of the second layer neuron, W1i-weight vector of the first layer neuron, B1 – bias of the first layer neuron, and Xi – input values vector for the first layer neurons.
But when I want to use this equation, I do not get the same results as the NN outputs. Also, I have used normalized and non-normalized input values in the equation, and obtained results are not same as NN outputs in both cases.
My question is whether the equation is correct or whether it is missing something?

Best Answer