"hanciong" wrote in message <email@example.com>... > But then what should I do if I want to integrate this interpolation function? The quad2d or integral2 or whatever make input of x and y arbitrarily; I can't force them to expand x input or y input to have same size.
But who force you to use anonymous function? Use in regular function, put interp2 followed by an appropriate reshape.
It is also not so smart to integrate an interpolation on grid by brute-force numerically integration. One can obtain the result directly from the grid values, if you are willing to make a little work beforehand. Or or lazier way of using summing Gauss point would be more economic.