%% Match Text
% Create a string array.

str = ["Mercury","Venus","Earth","Mars"]

%
% Find the strings that match "Earth". Return a logical array where the position of each element equal to 1 corresponds to the position of a matching string in str.

TF = matches(str,"Earth")

%
% Display the match by indexing back into str using TF.

str(TF)

% Copyright 2019 The MathWorks, Inc.