samer@0: % amatrix - arrow to generate sequence by scanning through an array samer@0: % samer@0: % amatrix :: [[N,M]] -> arrow({},{[[N]]},1..M). samer@0: function o=amatrix(X) samer@0: state=1; samer@0: len=size(X,2); samer@0: o=unfolder(@sfn1,state); samer@0: samer@0: function [x,S]=sfn(S) samer@0: x=X(:,S); samer@0: S=1+mod(S,len); samer@0: end samer@0: samer@0: function [x,S]=sfn1(S) samer@0: if S>len, error('ARROW:EOF','End of arrow sequence'); end samer@0: x=X(:,S); samer@0: S=S+1; samer@0: end samer@0: end