Input matrix with f(x,y) functions

Hi all,

I have a problem that I don't know how to solve. I want to do some matrix calculations, where i have units and waves in the same matrix, e.g. in a 2x2 matrix, position [0][0]=f(x,y), [0][1]=f(x,y), [1][0]=f(x,y), and [1][1]=f(x,y). Is this possible to do?

Thanks for answers

 

Thomas

Presumably you mean to fill in the matrix elements with distinct functions, not the same ones as indicated above. Here is an example using my made-up functions, which could be replaced by waves having 'x' and 'y' arguments (be sure to reference or pass the waves):

function foo(x1,x2,y1,y2)
    variable x1,x2,y1,y2    //  scale values

    Make/O/N=(2,2) myMatrix
    setscale/I x, x1,x2,"",myMatrix
    setscale/I y, y1,y2,"",myMatrix
    myMatrix={{sin(2*pi*x/10)*cos(4*pi*y/10), cos(2*pi*x/10)*sin(4*pi*y/10)},{sin(6*pi*x/10)*cos(8*pi*y/10), cos(6*pi*x/10)*sin(8*pi*y/10)}}
end

If you use functions, the example can be generalized by using external prototype functions. In the example, the 'x' and 'y' values take on the variable input limits.

DisplayHelpTopic "Function References"