www.pudn.com > snippets(1).rar > crossval_boundaries.m, change:2009-10-12,size:368b


function [f_start, f_end] = crossval_boundaries(num_subjects, num_folds)
%
% determine start and end values for cross-validation folds

n_fold = round(num_subjects/num_folds);

f_start = ones(1, num_folds);
f_end = repmat(n_fold, 1, num_folds);

for u = 2:num_folds

  f_start(u) = f_start(u-1)+n_fold;
  f_end(u) = f_end(u-1)+n_fold;

end

f_end(end) = num_subjects;