Using in-line function with fminbnd
조회 수: 8 (최근 30일)
이전 댓글 표시
hello
I have created a separate handler (minusF) to deal with function maximum (fminbnd -f). However this needs an in line function. I get errors when using this. Will someone please instruct me on in line creation?
Thanks.
댓글 수: 1
Stephen23
2015년 9월 11일
Don't use inline functions, use a function handle instead. They are much better for defining functions, and have many advantages over inline functions (which are considered essentially obsolete).
채택된 답변
Walter Roberson
2015년 9월 11일
minusF = @(x) -f(x)
No inline function needed, only an anonymous function.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!