How to use Matlab to solve equation like Mathcad
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi Guys,
How to use Matlab to solve equation like Mathcad.
I would like to solve below equation, but I don't know how to solve it in Matlab, could someone give me some suggestions, thanks.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1058545/image.png)
2 commentaires
Réponse acceptée
Karim
le 8 Juil 2022
Use the symboic toolbox to determine the equations, see below.
syms fp1 fp2 fz1 fz2 fc boost real
eqn = boost == ( atan(fc/fz1) + atan(fc/fz2) - atan(fc/fp1) - atan(fc/fp2) ) * 180/pi
fp2_eqn = solve(eqn, fp2)
% evaluate the solution by filling in some parameters
fz1 = 1239;
fp1 = 50000;
fc = 10000;
fz2 = fz1;
boost = 94.26;
fp2 = -fc/(tan(atan(fc/fp1) - atan(fc/fz1)- atan(fc/fz2) + pi*boost/180))
% print a string with 17 decimal numbers to compare with mathcad
fp2_s = sprintf('%4.17f',fp2)
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!