Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f1 = @(x) x(1);
- f2 = @(x) x(2);
- f3 = @(x) x(3);
- f = @(x) f1(x)+f2(x)+f3(x);
- aux = {f1,f2,f3};
- f = @(x) 0;
- for i=1:3
- f = @(x) f(x) + cell2mat(aux(i));
- end
- f = @(x)cellfun(@(c)feval(c,x),aux);
Add Comment
Please, Sign In to add comment