%% Determine If Input Names Are Field Names
% Create a structure.

S.x = linspace(0,2*pi);
S.y = sin(S.x);
S.title = 'y = sin(x)'

%
% Determine if 'title' is the name of a field of S.

TF = isfield(S,'title')

%
% You can test multiple names in one call to the isfield function by specifying them in a cell array or string array.

field = {'x','y','z','title','error'};
TF = isfield(S,field)

% Copyright 2018 The MathWorks, Inc.