MATLAB: Undefined operator ‘==’ for input arguments of type ‘function_handle’

Why do I receive the following error every time I run? "Why Undefined operator '==' for input arguments of type 'function_handle'"
Y = @(m,y) sin(theta)*m - cos(theta)*m - Q/(2*pi)*atan((m/y))
x=[];
for y = -100:0.1:100
x=[x; fzero(@(m,y) Y,25)];
end
Thanks, Eric

Best Answer

The fzero function solves for functions of one variable. You have two, so you would have to use fsolve or another optimisation function, and you have to address them as a vector of parameters for any of the optimisation functions to work.
I have no idea what you want to do, but this is one approach that will probably work:
Q = ...;
theta = ...;
m = ...;
Y = @(m,y) sin(theta)*m - cos(theta)*m - Q./(2*pi)*atan((m./y));
x=[];
for y = -100:0.1:100
yi = fzero(@(y) Y(m,y),25)
x=[x; yi];
end