1

Possible Duplicate:
Skipping outputs with anonymous function in MATLAB

Say I have a MATLAB function that returns two arguments:

[A,B] = twoArgsBack(x)

I want to write an anonymous function that uses B (e.g. for passing to a minimization routine)

myfun = @(x) sum(twoArgsBack(x))

will return the sum of A, ignoring the output from B. How can I write an anonymous function that returns the sum of B?

Community
  • 1
  • 1
Marc
  • 5,315
  • 5
  • 30
  • 36
  • Duplicate\Related: [Skipping outputs with anonymous function in MATLAB](http://stackoverflow.com/questions/3096281/skipping-outputs-with-anonymous-function-in-matlab), [define anonymous function as 2 of 4 outputs of m file function](http://stackoverflow.com/questions/3673392/define-anonymous-function-as-2-of-4-outputs-of-m-file-function) – gnovice May 16 '11 at 14:37
  • 2
    I agree, voted to close. – Marc May 16 '11 at 14:49

0 Answers0