Mercurial > hg > ishara
view sequences/diffwith.m @ 0:672052bd81f8
Initial partial import.
author | samer |
---|---|
date | Wed, 19 Dec 2012 22:38:28 +0000 |
parents | |
children |
line wrap: on
line source
function Y=diffwith(F,X) % diffwith - Generalised diff using argbitrary binary function % % diffwith :: (A,A->B), seq A -> seq B. % % The given function gets called with the current value as the % first arguments and the previous value as the second. Y=sfndata(@diffst,head(X),next(X)); function [y,s]=diffst(x,s) y=F(x,s); s=x; end end