annotate arrows/amatrix.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
parents |
672052bd81f8 |
children |
|
rev |
line source |
samer@0
|
1 % amatrix - arrow to generate sequence by scanning through an array
|
samer@0
|
2 %
|
samer@0
|
3 % amatrix :: [[N,M]] -> arrow({},{[[N]]},1..M).
|
samer@0
|
4 function o=amatrix(X)
|
samer@0
|
5 state=1;
|
samer@0
|
6 len=size(X,2);
|
samer@0
|
7 o=unfolder(@sfn1,state);
|
samer@0
|
8
|
samer@0
|
9 function [x,S]=sfn(S)
|
samer@0
|
10 x=X(:,S);
|
samer@0
|
11 S=1+mod(S,len);
|
samer@0
|
12 end
|
samer@0
|
13
|
samer@0
|
14 function [x,S]=sfn1(S)
|
samer@0
|
15 if S>len, error('ARROW:EOF','End of arrow sequence'); end
|
samer@0
|
16 x=X(:,S);
|
samer@0
|
17 S=S+1;
|
samer@0
|
18 end
|
samer@0
|
19 end
|