MATLAB: How to replace letters in a table column with a 1

binarystring replacementtable

Hi,
I have a column in a table that is filled with 'unidentified' and 'D' s. I would like to change this to a 1 if there is a 'D' and a 0 if there is a 'unidentified' in the cell.
seems very simple but has me stumped

Best Answer

f = @(x)strcmp(T.Column,x);
T.Column = f('unidentified') * 0 + f('D') * 1