Guest User

Untitled

a guest
May 20th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. f1 = @(x) x(1);
  2. f2 = @(x) x(2);
  3. f3 = @(x) x(3);
  4. f = @(x) f1(x)+f2(x)+f3(x);
  5.  
  6. aux = {f1,f2,f3};
  7. f = @(x) 0;
  8. for i=1:3
  9. f = @(x) f(x) + cell2mat(aux(i));
  10. end
  11.  
  12. f = @(x)cellfun(@(c)feval(c,x),aux);
Add Comment
Please, Sign In to add comment