필터 지우기
필터 지우기

I am trying to get started with fzero in matlab. Is there any tutorial to be found somewhere

조회 수: 1 (최근 30일)
fzero tutorial needed

채택된 답변

Walter Roberson
Walter Roberson 2022년 9월 4일
Unless you need specialized options, the basic form is one of
output_variable = fzero(@FUNCTION_NAME, STARTING_GUESS)
output_variable = fzero(@FUNCTION_NAME, [LOWER_BOUND UPPER_BOUND])
or pass in an anonymous function instead of @FUNCTION_NAME
The function indicated must expect exactly one scalar parameter, and must return a scalar real value (not complex)
Example:
format long g
fun = @(x) x.^4 - x.^2 - cos(x)
fun = function_handle with value:
@(x)x.^4-x.^2-cos(x)
xsol = fzero(fun, 2.8)
xsol =
1.14614057168858
fun(xsol)
ans =
-5.55111512312578e-16
Sometimes it is necessary to pass additional options, espcially if you want the output to be plotted as you go.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by