Cannot solve x*tan(x/w)=C in matlab, please help

The equation is x*tan(x/w)=C and .
w = 1e-6 C = 3.5e3
Here's how I do it:
x0 = pi/4
eq = sprintf('x*tan(x/%g) == %g', w, C);
gamma_pde = fzero(eq4, x0)
Depending on the value of x0, I get different results which are totally wrong, and do not work in the original equation. I know that this equation has infinite number of answers, that's why I'm setting x0, but I dont seem to have any luck solving it with matlab.
I dont know if I can use some other commands like solve, b/c this equation has so many answer.
Thanks for reading.

댓글 수: 1

Please format the code properly: http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question

댓글을 달려면 로그인하십시오.

답변 (1개)

Oleg Komarov
Oleg Komarov 2011년 8월 1일

0 개 추천

eq4 = @(x) x*tan(x/w)-C;
Use anonymous functions but be careful with the constants (see paragraph Variables Used in the Expression)

카테고리

도움말 센터File Exchange에서 Function Creation에 대해 자세히 알아보기

질문:

2011년 8월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by