Solving equations by calling a function

5 vues (au cours des 30 derniers jours)
abhijeet singh
abhijeet singh le 11 Fév 2021
Commenté : abhijeet singh le 11 Fév 2021
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.

Réponse acceptée

David Hill
David Hill le 11 Fév 2021
function B=eqnB(E,F)
fun=@(b)b*tanh(b)-E*F;
B=fsolve(fun,1);
end
  3 commentaires
David Hill
David Hill le 11 Fév 2021
You have to name your function something. What do you want to name it?
abhijeet singh
abhijeet singh le 11 Fév 2021
ok i got it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by