Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Calculating a function
Replies: 6   Last Post: Mar 5, 2014 6:01 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,919
Registered: 12/7/04
Re: Calculating a function
Posted: Mar 5, 2014 5:06 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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).




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.