Mercurial > hg > ishara
view sequences/@seq/diffwith.m @ 53:3ba80c9914ff
Minor doc fix, added .class to .hgignore
author | samer |
---|---|
date | Mon, 02 Feb 2015 10:47:55 +0000 |
parents | b1280319413e |
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=mapaccum(@diffst,head(X),next(X)); function [y,s]=diffst(x,s) y=F(x,s); s=x; end end