MATLAB: Selecting multiple strinfs of variables

multiple selection of strings

Dear all,
I have produced the following output
county interst rate
England b1
England b1
England b1
England b1
England b2
England b2
England b2
England b3
England b3
England b4
England b4
The above table says that for England we have different types of interest rate. I would like to select the values of interest rates that correspond to both bi and b2.
If I use the command
strcmp(mdata1(:,2),'b1')
i select only b1. But I want to select both b1 and b2 Any suggestions?
thanks in advance,
stef

Best Answer

Hi Stef,
I guess you are looking for ismember:
ismember(mdata(:,2), {'b1' 'b2'})
Titus