>> tA = cell2table(A,'variableNames',{'class','thickness'})
tA =
class thickness
_____ _________
'p' 1.2
'c' 1.8
'b' 0.5
'p' 2.6
'p' 0.8
'c' 1
'p' 1.2
'c' 8
'p' 1.8
>> tB = cell2table(B,'variableNames',{'class','t_min','t_max','att1','att2','att3','att4','att5'})
tB =
class t_min t_max att1 att2 att3 att4 att5
_____ _____ _____ ____ ____ ____ ____ ____
'b' 0.1 1 10 0.1 9.2 1.4 1.8
'b' 1.01 10 8 0.08 1.8 0.8 1
'c' 0.1 10 7 0.7 5.6 2 1.1
'p' 0.1 1 8 0.2 8 0.7 0.9
'p' 1.01 1.1 6 0.09 1.9 0.1 0.8
'p' 0.11 2 10 0.4 2.8 0.8 1.2
>> [tC,ida] = innerjoin(tA,tB);
>> [~,ida] = sort(ida);
>> tC = tC(ida,:);
>> idx = tC.thickness<tC.t_min | tC.thickness>tC.t_max;
>> tC(idx,:) = []
tC =
class thickness t_min t_max att1 att2 att3 att4 att5
_____ _________ _____ _____ ____ ____ ____ ____ ____
'p' 1.2 0.11 2 10 0.4 2.8 0.8 1.2
'c' 1.8 0.1 10 7 0.7 5.6 2 1.1
'b' 0.5 0.1 1 10 0.1 9.2 1.4 1.8
'p' 0.8 0.1 1 8 0.2 8 0.7 0.9
'p' 0.8 0.11 2 10 0.4 2.8 0.8 1.2
'c' 1 0.1 10 7 0.7 5.6 2 1.1
'p' 1.2 0.11 2 10 0.4 2.8 0.8 1.2
'c' 8 0.1 10 7 0.7 5.6 2 1.1
'p' 1.8 0.11 2 10 0.4 2.8 0.8 1.2
Best Answer