On 12/28/2012 12:47 PM, dpb wrote:
...
> b=1; t=6; n=3;
> idx=randperm(t,n); % doc randperm
> train = A(idx,:);
> test=A(setdiff([t:b],idx),:); % doc setdiff and friends...
typo...
test=A(setdiff([1:t],idx),:); % doc setdiff and friends...
Can't really generalize randperm just by t:b; it only takes the one
argument so if that's needed (didn't look like would be from original
post but just for the record) it'll need handling somewhat differently.
--
...
> b=1; t=6; n=3;
> idx=randperm(t,n); % doc randperm
> train = A(idx,:);
> test=A(setdiff([t:b],idx),:); % doc setdiff and friends...
typo...
test=A(setdiff([1:t],idx),:); % doc setdiff and friends...
Can't really generalize randperm just by t:b; it only takes the one
argument so if that's needed (didn't look like would be from original
post but just for the record) it'll need handling somewhat differently.
--