Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /data/1/b/1b32a628-bdcf-4151-86ff-5d5550106b39/nonconditional.com/public_html/wp-content/plugins/wp-syntax/wp-syntax.php on line 380
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /data/1/b/1b32a628-bdcf-4151-86ff-5d5550106b39/nonconditional.com/public_html/wp-content/plugins/wp-syntax/wp-syntax.php on line 380
Matlab has a nice feature that lets you chain commands by treating functions as variables. This means that you can write:
a = "foo"; b = feval(a,arg1,arg2,...) |
Now if we want to chain commands acting on the same input we can write:
myfoos = cell{'foo1','foo2','foo3',...}; x = ... chainedFoosOnX = applyChain(x,operators); function x = applyChain(x,operators) for ii = 1:length(operators) x = feval(operators{ii},x); end end |
Of course this example only works for one argument functions but it is simple to see how it would extend to more interesting scenarios.