Blue, I'm a little late to the party, but at least for those data, what you really ought to do is use a categorical for t.type. If you do, t.type == 'AA' absolutely will work.
As others said, string is newer than "cell arrays of char row vectors", and is a much better choice for text, but what you've shown for t.type looks like categorical, and I think you'll be happier storing it that way.
3 Comments
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/475573-how-to-subset-a-table-with-character-elements#comment_733535
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/475573-how-to-subset-a-table-with-character-elements#comment_733535
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/475573-how-to-subset-a-table-with-character-elements#comment_733540
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/475573-how-to-subset-a-table-with-character-elements#comment_733540
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/475573-how-to-subset-a-table-with-character-elements#comment_733577
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/475573-how-to-subset-a-table-with-character-elements#comment_733577
Sign in to comment.