Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Using Matlab to solve an equation

1 Ansicht (letzte 30 Tage)
Yachao Chen
Yachao Chen am 21 Jan. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello!
I am new to Matlab, and I would like to solve an equation:
The code I wrote is:
syms x;
eqn=(sqrt(1+(0.018/x))-sqrt(0.018/x))/(sqrt(1+(0.06/x)-sqrt(0.06/x))==1.12446);
solx=solve(eqn,x);
But when I put the answer back to the equation, it cannot give me the right value.
Can anyone help me with the solution? Thanks a lot!
  1 Kommentar
per isakson
per isakson am 21 Jan. 2018
Check the parenthesis

Antworten (1)

Birdman
Birdman am 21 Jan. 2018
Be careful with paranthesis as Per said. Below is the right one:
syms x;
eqn=(sqrt(1+(0.018/x))-sqrt(0.018/x))/(sqrt(1+(0.06/x))-sqrt(0.06/x))==1.12446;
solx=vpa(solve(eqn,x),4)

Community Treasure Hunt

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

Start Hunting!

Translated by