MATLAB: Hi! I have 2 tables and I would like to extract the rows in table A if the 2nd column of table A contains any of the values in table B. They are both formatted as tables. Any help would be great! Thank you very much!

intersectismemberrowstables

A= '01225' 201601 0.000486000000000000 '01553' 201602 0.000435000000000000 '01553' 201603 0.000412000000000000 '01553' 201604 0.000305000000000000 '01553' 201606 0.000308000000000000 '01558' 201602 0.000949000000000000 '01619' 201601 0.000440000000000000 '01619' 201604 0.000309000000000000 '01619' 201606 0.000304000000000000 '01619' 201607 0.000380000000000000 '01658' 201606 0.000306000000000000 '11026' 201512 0.000606000000000000 '11041' 201602 0.000464000000000000 '11041' 201604 0.000629000000000000 '11041' 201607 0.000412000000000000 '11044' 201511 0.00117400000000000 '11044' 201512 0.000597000000000000 '11044' 201602 0.000464000000000000 '11046' 201604 0.000684000000000000 '11046' 201605 0.000406000000000000 '11046' 201607 0.000389000000000000
B= 201605 201606 201607

Best Answer

result_T = T_A(ismember(T_A.Var2,T_B.Var1),:)