Mercurial > hg > ishara
annotate general/arrutils/chunk.m @ 29:61921dceded1
More documentation on type system.
author | samer |
---|---|
date | Sat, 19 Jan 2013 17:56:21 +0000 |
parents | 03694e5c8365 |
children |
rev | line source |
---|---|
samer@4 | 1 function B=chunk(A,n,step) |
samer@13 | 2 % chunk - return chunk from inside matrix |
samer@13 | 3 % |
samer@13 | 4 % chunk :: |
samer@13 | 5 % [[N,M]] ~'source array', |
samer@13 | 6 % K:natural ~'index of chunk', |
samer@13 | 7 % L:natural ~'chunk size' |
samer@13 | 8 % -> [[L,M]] ~'K block of L rows'. |
samer@4 | 9 |
samer@4 | 10 i=n*step+1; |
samer@4 | 11 B=A(i:i+step-1,:); |
samer@4 | 12 |
samer@4 | 13 |