Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vector valued function

0 views
Skip to first unread message

m y

unread,
Dec 31, 2009, 3:57:03 PM12/31/09
to
Hey all
Does anybody know about the multivariable function in matlab. I have a function
f=(f1,f2)' with two components f1 and f2.
where
f1= function of x,y , f2 also depends on x,y coordinates
.Kindly guide me if there is vecor valued function in matlab?
Best regards

John D'Errico

unread,
Dec 31, 2009, 4:27:03 PM12/31/09
to
"m y" <ail...@gmail.com> wrote in message <hhj36v$1jh$1...@fred.mathworks.com>...

Trivially so. Any function that returns a vector is a
vector valued function.

John

m y

unread,
Dec 31, 2009, 5:27:03 PM12/31/09
to
"John D'Errico" <wood...@rochester.rr.com> wrote in message <hhj4v6$j6a$1...@fred.mathworks.com>...
> Thanks for response but I am looking for matlab command to run this function? I know that it is a vector valued but I am looking for a command for vector valued function. One way is simply define each component as a scalar function, but thats not the case with my problem.

I want to look at function where you give input vectors and function command on the given input will result a vector.
> John

John D'Errico

unread,
Dec 31, 2009, 7:08:02 PM12/31/09
to
"m y" <ail...@gmail.com> wrote in message <hhj8fm$r6c$1...@fred.mathworks.com>...

Still trivial. You need to start reading the getting
started documentation.

John

Matt J

unread,
Dec 31, 2009, 7:19:05 PM12/31/09
to
"m y" <ail...@gmail.com> wrote in message <hhj36v$1jh$1...@fred.mathworks.com>...


I don't know if it helps, but here's an example

>> f=@(x,y) [x+y;x-y] %A vector-valued function

f =

@(x,y)[x+y;x-y]


>> f(1,2) %evaluate at x=1, y=2

ans =

3
-1

Matt J

unread,
Dec 31, 2009, 7:29:20 PM12/31/09
to
"m y" <ail...@gmail.com> wrote in message <hhj8fm$r6c$1...@fred.mathworks.com>...

> I want to look at function where you give input vectors and function command on the given input will result a vector.


Here's an equivalent example to what I had before, but where the input is passed to the function as a vector instead of each component separately:

>> f=@(xy) [xy(1)+xy(2) ; xy(1)-xy(2)] %A vector valued function of a vector argument

f =

@(xy)[xy(1)+xy(2);xy(1)-xy(2)]

>> f([1,2])

ans =

3
-1

0 new messages