I am a beginner, can anyone please help me writing a code for this equation to find 'x' using iteration
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am a beginner, can anyone please help me writing a code for this equation to find 'x' using iteration......
Answer is something approximately 10.59
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/428798/image.jpeg)
0 commentaires
Réponses (2)
Ameer Hamza
le 26 Nov 2020
You can use fzero()
eq = @(x) gamma(1+2./x)./gamma(1+1./x).^2 - 1 - (4.56/40)^2;
x0 = 10;
sol = fzero(eq, x0)
Result
>> sol
sol =
10.5865
0 commentaires
Walter Roberson
le 26 Nov 2020
That looks like homework.
syms x
lhs = 1 + sym(4.56)^2/sym(40)^2;
rhs = gamma(1+2/x) / gamma(1+1/x)^2
fplot([lhs-rhs,0], [-20 -5])
fplot([lhs-rhs,0], [-0.75 -0.6])
%fplot([lhs-rhs,0], [-0.5 -0.01])
fplot([lhs-rhs,0], [2.5 20])
There might also be a crossing close to 0, but the plot near there takes too much execution time for me to demonstrate it.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!