matthiasm@8: function short = splitLongSeqIntoManyShort(long, Tsmall) matthiasm@8: % splitLongSeqIntoManyShort Put groups of columns into a cell array of narrower matrices matthiasm@8: % function short = splitLongSeqIntoManyShort(long, Tsmall) matthiasm@8: % matthiasm@8: % long(:,t) matthiasm@8: % short{i} = long(:,ndx1:ndx2) where each segment (except maybe the last) is of length Tsmall matthiasm@8: matthiasm@8: T = length(long); matthiasm@8: Nsmall = ceil(T/Tsmall); matthiasm@8: short = cell(Nsmall,1); matthiasm@8: matthiasm@8: t = 1; matthiasm@8: for i=1:Nsmall matthiasm@8: short{i} = long(:,t:min(T,t+Tsmall-1)); matthiasm@8: t = t+Tsmall; matthiasm@8: end