Question: How to choose specific elements of a vector in Maple?

I have a big vector composed of different real values elements. I want to extract the value of elements that are between specified interval (x1<val<x2) and their corresponding element numbers. How is it possible in Maple in simplest way?

For example suppose R:=[ 4,-1,9,11,-4,2,4,1,-1,2.2,112,44,-134,0.124,34,41,7,97,13.22123]:

I want the elements that their values are in the interval of -2<val<3 and their corresponding element numbers. 

Namely: vals:=[-1,2,1,-1,2.2,0.124] and their corresponding numbers: Numbs:=[2,6,8,9,10,14]

Please Wait...