
Re: Calculating a function
Posted:
Mar 5, 2014 5:06 PM


On Thursday, March 6, 2014 10:54:07 AM UTC+13, canon wrote: > > Did you even read Tideman's answer ? > > > If instead of > > > > > x=linspace(a,b,nx); % nx is the no of points in x > > > > > y=linspace(c,d,ny); % ny is the no of points in y > > > you write > > > x=[2, 4, 5, 9]; > > > y=[1, 2, 4, 8]; > > > you are done. > > > > > > Best wishes > > > Torsten. > > > > Thanks, Assuming each x and y value has its own f(x) and f(y) and I am looking for the function (z=f(x,y), f(x)*f(y)). That is it has 2 dimension, one is f(x,y) and another one is f(x)*f(y) for each pair of x and y. How can I figure it out? > > > > Thanks
So the function f(x,y) must be different to f(x) and f(y), correct? So, how about: x=[2 4 5 9]'; % Make them column vectors y=[1 2 4 8]'; z=[function_xy(x,y) function_x(x).*function_y(y)];
This will produce a matrix z(4,2) (assuming the functions produce column vectors).

