0

I have a function that changes by loop , as below

f(x,y)=(i-1)*x+(j-1)*y
g(x,y)=(i+1)*x+(j+1)*y

The real function is more Complex than this, however/

I want to calculate the integration of f(x,y)*g(x,y) when i & j are changed by the loop.

I want to calculate like below in matlab, but this code isn't correct.

for i=1:n
for j=1:n
h=@(x,y)(f*g) % f & g are functions
int=integral2(h,xmin,xmax,ymin,ymax);
end
end


function m=f(x,y,i,j)
m=(i-1)*x+(j-1)*y
end
David
  • 2,298
  • 6
  • 22
  • 56
mohammad
  • 1
  • 2
  • You need to explain why it isn't correct, what the results are, and what the expected results are. – David Dec 09 '16 at 11:03
  • well i don't know how to use function handle for looped functions & how to calculate them. i just wrote this code to say what i want to do. – mohammad Dec 09 '16 at 11:37

0 Answers0