i need to solve the ecuation: f(x)=sqrt(x)-cos(x) but im given the following interval [0,1]

12 views (last 30 days)
i need to solve the ecuation: f(x)=sqrt(x)-cos(x) but im given the following interval [0,1]

Answers (1)

Sam Chak
Sam Chak on 16 Sep 2022
Hi @Eva
f = @(x) sqrt(x) - cos(x)
f = function_handle with value:
@(x)sqrt(x)-cos(x)
fplot(f, [0 1])
x0 = 0.6; % guess the solution is relatively close to x = 0.6
xsol = fzero(f, x0)
xsol = 0.6417

Categories

Find more on Quantum Chemistry in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!