MATLAB: Mathematical equation of regression in ANN for two hidden layers

Deep Learning Toolboxneural networksregression equation

For the following equation of regression for neural network,
y = b2 + LW*tanh(b1+IW*x)
Can this equation be used for two hidden layers? Or is it only valid for one hidden layer? If not, how can I get the equation for two or more hidden layers?
I'm using an ANN with two hidden layers since it gives a better mse for my model.
Thanks.

Best Answer

yn = B3+ LW2* tanh( B2+ LW1* tanh( B1+ IW* xn ))
Where xn are normalized input values obtained from MAPMINMAX and yn is a normalized output value that can be denormalized using reverse MAPMINMAX target(t) parameters.
B1, B2 and B3 are constant matrices whose dimensions depend on the sizes of x, t and [ H1 H2 ].
Weight values are carefully determined from net.b, net.IW and net.LW.
Hope this helps.
Thank for formally accepting my answer
Greg