I have a vector :
I want to have a function that can select a segment of the vector from index "a" to index "b" such that if "a" is greater than "b", it loops back on the vector and starts from the beginning, i.e., I want the function
function y = circularSelect(v , a, b)
circularSelect(v , 7 , 2)
I'd like to know if there's a way to do it without using "if" statements, since it's quite trivial how to do it with an "if" statement.
thanks for your answers in advance