MATLAB: How to convert 2*1 cell array into 1*2char array

cell arrayscharcharacter arrayconvertstring

egr = Tier' % egr returns 'T2' 'S2' as 1*2 CELL
sgr = char(egr); % sgr returns T2
S2 as 2*2 char
My desired output should look like 'T2' 'S2' or 'T2','S2' in char

Best Answer

egr = {'T2' 'S2'};
sgr = ['''', strjoin(egr, ''' '''), ''''];
disp(sgr)
This will display as
'T2' 'S2'
which is to say that sgr will be a character vector that contains those literal characters, which appears to be what you are asking for.
However, this appears to have nothing to do with your switch statement, since you have
switch (T3)
and T3 has nothing to do with egr or sgr.