MATLAB: I have X data with in that I want to use X data between 8 to 200 for further calculations. but in that range I want to reject the X data below 15 which has Y value less that 0.5. Please tell me how to do it.

data extraction

Best Answer

A = [13	0.642769
13	0
15	0.096687
14	0.09668
14	0
12	0.371955
14	0
14	0.030574
43	1
35	8
16	0
62	3
85	15
20	1
38	1
24	8
22	1
84	0
17	0 ] ;
X = A(:,1) ; 
Y = A(:,2) ;
% Method 1 
idx = Y<0.5 ; 
iwant = [X(~idx) Y(~idx)]
% Method 2 
idx  = Y>=0.5 ;
iwant = [X(idx) Y(idx)]