Given a number of samples forming an arbitrary dataset, this function creates K sets for training and validation so as that each sample is used once and only once for validation purpose and K-1 times for training purpose.
Marco Vannucci (2020). Cross validation sets (https://www.mathworks.com/matlabcentral/fileexchange/50101-cross-validation-sets), MATLAB Central File Exchange. Retrieved .
Inspired: Simple, Repeated and Nested Cross-Validation and Bootstrapping fold generation, threeD_grasp, Transformation matrix for stress and strain, Truss displacement based on FEM, fileread(sec1,sec2,point), myroots(Pcoef,tol,rootclass), Truss simulation