this is what I've ended up doing for those interested (don't know why I didn't think of it sooner):
for dimension=1:3
for direction=-1:2:1
vec = zeros(3,1);
vec(dimension) = direction;
this_point = point + vec;
this_point(dimension) = mod(this_point(dimension)-1,size(obj.int_ref,dimension))+1;
end
end
note that this is matlab code, and so the arrays' indeces start at 1 (hence the unusual mod line).