Mercurial > hg > ishara
comparison general/funutils/compose.m @ 12:fbc0540a9208
Moved some high-order functions from funutils to arrutils, updated docs and cleaned up funutils.
author | samer |
---|---|
date | Mon, 14 Jan 2013 22:21:11 +0000 |
parents | e44f49929e56 |
children |
comparison
equal
deleted
inserted
replaced
11:8eec969fd4d3 | 12:fbc0540a9208 |
---|---|
1 function h=compose(f,g) | 1 function h=compose(f,g) |
2 % compose - Constructs composition of two functions | 2 % compose - Constructs composition of two functions |
3 % | 3 % |
4 % compose :: (B->C), (A->B) -> (A->C). | 4 % compose :: (B->C), (A{1:N}->B) -> (A{1:N}->C). |
5 % | 5 % |
6 % returns the function h such that h(...) = f(g(...)) | 6 % returns the function h such that h(...) = f(g(...)) |
7 | 7 |
8 h=@fg; | 8 h=@fg; |
9 function x=fg(varargin), x=f(g(varargin{:})); end | 9 function x=fg(varargin), x=f(g(varargin{:})); end |