0

I have a function handle that returns 3 values.

@f(x,y) = basis_handle(x,y);

[z, dx, dy] = f(0.1,0.1) %returns 3 vectors

what I'd like to do now is create a function handle that performs a dot product of each of those 3 vectors with another vector. Something like:

@f_2(x,y) c'*f(x,y) %c is a known vector, same size as ones returned by @f(x,y)

As it is, this handle returns only 1 value, even if I try to ask for more, i.e. this produces an error:

[z, dx, dy] = f_2(0.1,0.1)

Is there any way to create a function handle that returns all 3 values as requested?

Lukas Bystricky
  • 1,222
  • 6
  • 16
  • 34
  • If z, c etc are column vectors, then f_2 returns a vector of three values, each corresponding to one of the dot products, right? – Luis Mendo Nov 24 '13 at 17:00
  • @LuisMendo : it's correct that `c'*[z,dx,dy]` returns a vector of 3 values, but I can't incorporate that into a function handle. So I guess I don't actually need f_2 to return 3 outputs, but I need f to pass 3 vectors to f_2. I think that's where the problem is. – Lukas Bystricky Nov 24 '13 at 17:03

0 Answers0