Root of a function

조회 수: 2 (최근 30일)
Carlos Tavares
Carlos Tavares 2018년 1월 7일
편집: Matt J 2018년 1월 7일
Hello, I'm new in the Matlab world, so i need some help.
I need to Determine the roots of a function of a variable function (the function is required by the algorithm and inserted by the user the user). The user inserts two initial points, one of which the function is positive, in the other is negative.
Thank you

답변 (1개)

Matt J
Matt J 2018년 1월 7일
편집: Matt J 2018년 1월 7일
Use the fzero() command. E.g.,
>> [xroot,fval]=fzero(@cos,[pi/4, 3*pi/4])
xroot =
1.5708 %pi/2
fval =
6.1232e-17

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by