Trivially so. Any function that returns a vector is a
vector valued function.
John
I want to look at function where you give input vectors and function command on the given input will result a vector.
> John
Still trivial. You need to start reading the getting
started documentation.
John
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
> 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