MATLAB: Problem filtering a table

strcmptable

I am trying to filter a table using the following code
raw=readtable("small.xlsx");
p='WSMS, Ashulia';
%loop
A = raw(strcmp(raw( : ,2),p))
but getting the following error.
Subscripting a table using linear indexing (one subscript) or multidimensional indexing (three or more
subscripts) is not supported. Use a row subscript and a variable subscript.
Can anyone correct me please

Best Answer

A = raw(strcmp(raw( : ,2),p),:)
% ^