Input argument

function y = f1(x)
% A univariate function with a simple zero
syms x
y = cos(x) - x;
r = fzero('f1', 0.5)
It gives the following error
Error in ==> oct3 at 5 r = fzero('f1', 0.5) >>

回答(2 个)

Walter Roberson
Walter Roberson 2011-11-2

0 个投票

Why is the error in the file oct3 when all you show us is the file f1 ?
What is the error message you are getting?

1 个评论

??? Input argument "x" is undefined.
Error in ==> oct3 at 4
y = cos(x) - x;
This error allows happen in similar programs considering "x" is undefined

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Nonlinear Optimization 的更多信息

标签

提问:

2011-11-1

Community Treasure Hunt

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

Start Hunting!

Translated by