Yes there is. I just mentioned the simplest difference between the two:
fsolve can be used to solve a single equation of a variable for zero. However, fzero will find zero if and only if the function intersects the x axis.
Here is a simple example: Consider the function f=x^2 . The function is non-negative for all real values โโof x . It has a root at x=0 . We will define the anonymous function as f=@ (x)x.^2; and try to find the root using both methods.
Using fsolve
options=optimset('MaxIter',1e3,'TolFun',1e-10); fsolve(f,0.1,options) Equation solved. fsolve completed because the vector of function values is near zero as measured by the selected value of the function tolerance, and the problem appears regular as measured by the gradient. <stopping criteria details> ans = 1.9532e-04
Not zero, but close.
Using fzero
fzero(f,0.1) Exiting fzero: aborting search for an interval containing a sign change because NaN or Inf function value encountered during search. (Function value at -1.37296e+154 is Inf.) Check function or try again with a different starting value. ans = NaN
He cannot find zero.
Consider another example with the function f=@ (x)x.^3; that intersects the x axis and has a root at x=0 .
fsolve(f,0.1) ans = 0.0444 fzero(f,0.1) ans = -1.2612e-16
fsolve in this case does not return exactly 0 . Even when using the options that I defined above, only 0.0017 with fsolve gets me. However, fzero answer is correct, accurate to the machine !. The difference in answers is not in inefficient algorithms. This is because their goals are different .
fzero has a clear goal: find zero! Simply. There are no ambiguities. If it crosses the x axis, then there is zero, and it will find it (only for real). If he does not cross, he whines.
However, the fsolve area is wider. It is designed to solve a system of nonlinear equations. Often you cannot find the exact solution to these equations and must set the tolerance level at which you are ready to make a decision as an answer. As a result, there are many options and tolerances that need to be adjusted manually in order to massage the exact root. Of course, you have finer control, but to find the zero of one var equation I find this a pain. I would fzero use fzero in this case (assuming it crosses the x axis).
Besides this significant difference, there are differences in implementations and algorithms used. To do this, I will give you an online documentation of the features (see links above).