view sequences/@extractdata/extractdata.m @ 3:3f77126f7b5f

First major revision of sequence library, now using classdef form, STILL A BIT BROKEN!
author samer
date Wed, 09 Jan 2013 22:22:21 +0000
parents 672052bd81f8
children
line wrap: on
line source
function o=extractdata(source,dim,range)
% extractdata - Sequence of extracts from source sequence
%
% extractdata :: seq [[Size]], D:natural, [[2]->[Size(D)]] -> seq [[Size2]].
%
% extractdata is basically the same as fndata extract but more efficient.

	sz=size(source); 
	sz(dim)=range(2)-range(1)+1;
	o.dim=dim;
	o.range=range;
	o=class(o,'extractdata',ddata(source,sz,'datafn',@dfn,'stringfn',@sfn,'nextfn',@next_c));


function x=dfn(o), x=extract(source(o),o.dim,o.range);
function s=sfn(o)
	s=sprintf('[%d/%d:%d]', o.dim, o.range(1), o.range(2));