Error using fzero function
Show older comments
Hi guys,
I'm trying to use fzero to find the root of my function. It's nonlinear. But I'm getting this Error:
Error using fzero (line) FUN must be a function, a valid string expression, or an inline function object.
y = -0.6:0.001:0.6;
z = 0.1;
solutionsofthefunction = arrayfun(@(x) functionname(y, x), z);
fun = arrayfun(@(x)theta_delta_plot(z, x), y);
x0 = 0;
x = fzero(fun, x0)
can anyone give me a hint what I'm doing wrong?
Accepted Answer
More Answers (1)
Roger Wohlwend
on 19 Jan 2016
0 votes
As the error message says, fzero needs a function handle as first Input Argument. Your variable fun is a Vektor or a Matrix, if I am not mistaken. Your code is a bit confusing. The first four lines don't have anything to do with your Goal of finding the Zeros of your function.
2 Comments
Simon Kreibich
on 19 Jan 2016
Edited: Simon Kreibich
on 19 Jan 2016
Roger Wohlwend
on 19 Jan 2016
Sorry, I still have no clue what you mean with your lines 2 and 3. Part of the Problem is the variable and function names. If you speak German, as I suspect, please formulate your Problem in German. Describe in Detail what you want to do.
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
