MATLAB: Solving equations by calling a function

equationsfunctionmathematicsMATLAB

I have a function A=B*C+D, here B,C,D are all different functions (say it Equation 1)
For B, the equation is B*tanh(B)=E*F (say it Equation 2)
Now i want to extract B from this equation and use it in Equation 1. For me the problem is B is not defined explicity, is there any way to extract B and use it in equation 1.

Best Answer

function B=eqnB(E,F)
fun=@(b)b*tanh(b)-E*F;
B=fsolve(fun,1);
end