You cannot do that. fzero() is based upon the assumption that when upper and lower bounds are provided, that they are constant, not values that vary according to the current "x" value. (Your "w" varies from -a to +a rather than being fixed.)
My trouble is Matlab does not understand 2*sin(5*w)/w = 2 when w = 0 not NaN
The limit of sin(p*x)/x as x approaches 0 is p, not 1.
If you need to avoid the NaN when dividing by 0, then use "if" to check the denominator before you do the division. Or use isnan() on the result to check to see if you got NaN.
Best Answer