MATLAB: Undefined operator ‘==’ for input arguments of type ‘cell’.

how to correct this errorMATLAB Production Server

load hospital
hospital.Properties.ObsNames(1:10)
dsMale = hospital(hospital.Sex=='Male',:);
dsMale(1:10,{'LastName','Sex'})
this above code is present in matlab documentation this work well....
where as i tried in different dataset....
[~,~, AllData] =xlsread('play.xls','Sheet1','A1:E15');
student = cell2dataset(AllData);
ds1=student(student.class=='first',:) % i need to store in another dataset student details who's class is first
i get an error…Undefined operator '==' for input arguments of type 'cell'.

Best Answer

Use strcmp to compare a cell array of char vectors to another char vector:
ds1 = student(strcmp(student.class, 'first'), :)