MATLAB: Fimplicit gives a warning ”Function behaves unexpectedly on array inputs.”

fimplicitwarning

I just wanna plot a dispersion equation according to the paper.
here is my code, really simple.
clc,clear all,
fimplicit(@(x,y) 9*y^4-((1-9)*9+2*9^2*10*(1-cos(x)))*y^2+2*9^2*10*(1-cos(x)),[-3 3 0 20]);
But the plot is not accurate near 0. What is going on and how can I fix it?
Warning message:
Warning: Function behaves unexpectedly on array inputs. To improve
performance, properly vectorize your function to return an output
with the same size and shape as the input arguments.
> In matlab.graphics.function.ImplicitFunctionLine>getFunction
In matlab.graphics.function.ImplicitFunctionLine/updateFunction
In matlab.graphics.function.ImplicitFunctionLine/set.Function_I
In matlab.graphics.function.ImplicitFunctionLine/set.Function
In matlab.graphics.function.ImplicitFunctionLine
In fimplicit>singleFimplicit (line 185)
In fimplicit>@(f)singleFimplicit(cax,f,limits,extraOpts,args) (line 148)
In fimplicit>vectorizeFimplicit (line 148)
In fimplicit (line 126)
In Test (line 2)
>>

Best Answer

vectorize your function . use .* instead of * and use .^ instead of ^