Finding a nonlinear equation root

조회 수: 3 (최근 30일)
Doga Selcuk
Doga Selcuk 2023년 4월 17일
답변: Torsten 2023년 4월 17일
Hello everyone, i have an equation such that cosh(x)*cos(x)+1=0. I can solve with fsolve but this solver does not give me root, i need to give an interval. How can i solve and finding roots for this equation? Is there any possibilty to solve with using fzero to find roots directly ?In my book roots are:1.875,4.694 and goes on and on
Thanks

답변 (1개)

Torsten
Torsten 2023년 4월 17일
fun = @(x)cosh(x).*cos(x)+1;
icount = 0;
for i = 1:2:21
x0 = i*pi/2;
icount = icount + 1;
xroot(icount) = fzero(fun,x0);
end
xroot
xroot = 1×11
1.8751 4.6941 7.8548 10.9955 14.1372 17.2788 20.4204 23.5619 26.7035 29.8451 32.9867

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by