MATLAB: Delete specific rows from a cell array

cell arrayremovespecific

Hello everyone, i have a cell array just like this:
value Class
1200 'Unknown - State'
1700 'Rest'
1600 'Unknown - State'
2100 'City'
How i'm going to remove the rows whose class is 'Unknown-State' so my result cell array woulb be like this:
Value Class
1700 'Rest'
2100 'City'

Best Answer

Assuming your cell array is name "C", then
removeIndex = strcmp(C(:,2),'Unknown - State');
C(removeIndex,:) = [];
If you don't know ahead of time that the class is the second column, then you could find the class column number using
classIdx = find(strcmp(C(1,:),'Class'))