MATLAB: Find result from multiple if and range value

mathematicsMATLAB

hello, can someone help me? i have a set of range and i need the number produced from the the range. example: if i input a value of 0.17,it will find 0.17 is in which range (in this case it is in between 0.138 to 0.205) and then it will display the number of that range category which is 6.0
0.0 To 0.068 = 7.0
0.069 To 0.137 = 6.5
0.138 To 0.205 = 6.0
0.206 To 0.274 = 5.5
0.275 To 0.342 = 5.0 .
0.343 To 0.410 = 4.5
0.411 To 0.479 = 4.0
0.480 To 0.547 = 3.5
0.548 To 0.615 = 3.0
0.616 To 0.684 = 2.5
0.685 To 0.752 = 2.0
0.753 To 0.821 = 1.5
0.822 To 0.890 = 1.0

Best Answer

Edit2
r=[0.0 .068 7.0
0.069 0.137 6.5
0.138 0.205 6.0]
a=0.032
b=mat2cell(r(:,1:2),ones(size(r,1),1),2)
idx=cellfun(@(x) x(1)<=a & x(2)>=a,b)
sprintf('the range of a is %0.1f',r(idx,3))