Finding the root of a function between an interval

Probably a stupid question, but how do I find the root of test1 between the interval [0,1]?
x = 0:0.1:2;
y = 1 - sin(x);
z = x.^2;
test1 = y - z;

 채택된 답변

Torsten
Torsten 2022년 12월 5일
편집: Torsten 2022년 12월 5일
format long
y = @(x) 1 - sin(x);
z = @(x) x.^2;
test1 = @(x) y(x)-z(x);
x = fzero(test1,[0 1])
x =
0.636732650805282

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2022b

질문:

2022년 12월 5일

댓글:

2022년 12월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by