From: Chen Chen on
Hi everyone,

My problem is : I want to integrate f(x,y)*q(x) over x~(a,b),y~(c,d).
f(x,y) and q(x) are discrete numbers not functions.
The f(x,y) is a two-dimensional function which is dispalyed in discrete numbers. I couldn't figure out how to do this integration. Any suggestion is appreciated.

Chen
From: Joseph on
I'm not sure I understand this. How are these numbers generated? You need to have some knowledge of the problem before applying numerical methods to it.



"Chen Chen" <chenchen_ee(a)yahoo.com> wrote in message <i3p629$8oh$1(a)fred.mathworks.com>...
> Hi everyone,
>
> My problem is : I want to integrate f(x,y)*q(x) over x&#65374;(a,b),y~(c,d).
> f(x,y) and q(x) are discrete numbers not functions.
> The f(x,y) is a two-dimensional function which is dispalyed in discrete numbers. I couldn't figure out how to do this integration. Any suggestion is appreciated.
>
> Chen
From: Chen Chen on
"Joseph " <don'twannapostit(a)nopers.com> wrote in message <i3p9ap$9ih$1(a)fred.mathworks.com>...
> I'm not sure I understand this. How are these numbers generated? You need to have some knowledge of the problem before applying numerical methods to it.


Hi Joseph,

I just simplify the problem i want to solve to this imple double mathematical problem. I thought it would be confusing if I explained the whole thing.
Sorry I didn't state the problem clearly. Here is a specific version.
These numbers are given sets of data. That is: x and y are two sets of data which are given at the first place. Let's say both the x and y are 1 X N vectors. f(x,y) is given too and it's an N X N matrix. q(x) is a function depending on x only and I know the function already. So q(x) is a 1 X N vectors with known numbers.
My problem is that I don't know how to integrate f(x,y)*f(x) over x and y numerically. I hope I expained it clearly this time.

Chen
From: Walter Roberson on
Chen Chen wrote:
> "Joseph " <don'twannapostit(a)nopers.com> wrote in message
> <i3p9ap$9ih$1(a)fred.mathworks.com>...
>> I'm not sure I understand this. How are these numbers generated? You
>> need to have some knowledge of the problem before applying numerical
>> methods to it.
>
>
> Hi Joseph,
>
> I just simplify the problem i want to solve to this imple double
> mathematical problem. I thought it would be confusing if I explained the
> whole thing. Sorry I didn't state the problem clearly. Here is a
> specific version.
> These numbers are given sets of data. That is: x and y are two sets
> of data which are given at the first place. Let's say both the x and y
> are 1 X N vectors. f(x,y) is given too and it's an N X N matrix. q(x) is
> a function depending on x only and I know the function already. So q(x)
> is a 1 X N vectors with known numbers. My problem is that I don't
> know how to integrate f(x,y)*f(x) over x and y numerically. I hope I
> expained it clearly this time.

Typical numeric integrals rely upon implied continuity, that f(x) is some
value then there is some (unknown but present) path from f(x-1) to f(x) to
f(x+1). When, though, you say that the data is discrete, then you disclaim any
implied continuity, leaving us with no knowledge of what you mean by
"integrate" in this situation. Do you want each value f(x,y) to apply over the
semi-closed intervals [x, x+1) and [y, y+1), or do you want f(x,y) to apply
over [x-1/2, x+1/2) and (y-1/2, y+1/2) or something else? And in the integral,
should the neighbouring values be ignored when considering f(x,y)*q(x), or
should the neighbours be considered?

With the information you have given, it sounds to me as if you might simply want

sum( reshape( bsxfun('times', q(:), f), [], 1) )
From: Chen on
Hi walter,

The x and y are given domain. Let's say x~(-10,10), y ~(10,100).

Chen