%% Cell Char String p.18 A={'Mercury','Gemini','Appolo';... 'Skylab', 'Skylab B', 'ISS'} % What it means? A{end} A{2,2}(1:3) %% cell->string str=string(A), str(1,2) %% cell->char B=str2mat(A) % old version, space added to each row B=char(A) % the second way %% You need to explain mistake and fix it! clear A; % A=['Mercury','Gemini','Appolo';... % 'Skylab', 'Skylab B', 'ISS'] %% Analysis and Edition p.19 C={'my mind is strong'; 'my mind is resting'} %[ind]=findstr(C{1},'mind') % old version [ind]=strfind(C{1},'mind') S=[C{1},C{2}]; % What class does S belong to? length(S) == (?) CS=string(C) % size CS? [Ced,ind1]=unique(S); % without repetition S(ind1)==Ced % all(S(ind1)==Ced) [Ced,ind1]=unique(CS); % the only two elements %% comparison Char String TF=strcmp(C{1},C{2}) % == or ~= logicalVector=C{1}==C{2}(1:end-1) % eq(S1,S2) need the same length logicalVector=C{1}==C{2} % mistake: different length TF=strcmpi(C{1},C{2}) % Char: full comparison, for any length %____________________________ TF=strcmpi(CS(1),CS(2)) % each element - string TF=strcmpi(C(1),C(2)) % each element - cell % compare n elements TF=strncmp(C{1},C{2}(1:end-1),11) %% p.20 You can copy the code and implement it step by step! %% Important! Convert Char to ASCCI code res=double('xyz')