I am working on implementing cross validation at Matlab without using any other functions except for native ones.
I have a matrix like that:
1
2
3
..
N
I have a fold size M
At first iteration I want to take that:
1
2
3
..
N-M
at second iteration:
1
2
3
..
.. //Number o f M elements didn't included here
N-M+1
N-M+2
..
N
iterate until I process
M+1
M+2
..
N
When I don't include any set of elements I want to assign them into another variable or I want to know indexes so I can process them (this one is better for performance)
Further information about cross validation: http://en.wikipedia.org/wiki/Cross-validation_(statistics)
This graphic explains what I want(form Georgia Tech University slides):
I am new to matlab, how can I implement it easily?