string comparion on my dataset issues

7 views (last 30 days)
amit aylani
amit aylani on 8 Feb 2016
Commented: amit aylani on 9 Feb 2016
data.COLLEGE = cellVectors(:,3);
s1={'Sgsits'; 'SGSITS';'S.G.S.I.T.S'; 'Shri Govindram Seksaria Institute of Technology and Science'};
s2=data.COLLEGE;
data.COLLEGE=strcmp(s1,s2)
got error
Error using strcmp
Inputs must be the same size or either one can be a scalar.
Error in tyu (line 33)
data.COLLEGE=strcmp(s1,s2)

Answers (1)

Walter Roberson
Walter Roberson on 9 Feb 2016
ismember(s2, s1)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!