DOC: added examples
RF+BK: change order in which elements are returned to conform with sub2ind/ind2sub