MATLAB Answers

How to search a table for a string

165 views (last 30 days)
Jonathan on 12 Mar 2020
Answered: Abhisek Pradhan on 16 Mar 2020
Hi, I have a table of data. One of these columns includes a column which I have labelled 'Participant Data'
I want to search 'Participant Data' for a particular string and return all the index of this table when it does pop up.
Additionally if I have 2 arrays of indices, how to return just the numbers that are in both indices?

  1 Comment

dpb on 12 Mar 2020
  1. See strfind, contains and friends,
  2. intersect

Sign in to comment.

Answers (1)

Abhisek Pradhan
Abhisek Pradhan on 16 Mar 2020
Searching a table for a string can done using find and strcmp. A combination of both function can be used to search a string:
Refer the following link for model details.


Sign in to comment.

Translated by