Hi peoples,(adsbygoogle = window.adsbygoogle || []).push({});

Anyone know or have any ideas how we can better write this code to eliminate this quad2d warning???

Code (Text):num((i+1),(j+1)) = quad2d(@(x,y)inf_func(x,y,i,j),-pi,pi,-pi,pi);

The function code is:

The warning given is:Code (Text):function [y] = inf_func(x,y,m,n)

y = ((1-cos(m.*x+n.*y))./(1-(1/6)*(4*cos(x).*cos(y)+2*cos(2.*y))));

end

Any help is much appreciated!! Thanks > In quad2d at 242

Warning: Reached the maximum number of function evaluations (2000). The result

fails the global error test.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB - Reached the maximum number of function evaluations

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**