Doing direct comparison with strings isn't really going to work that way; certainly not with that syntax. A string is just a character vector. If you try to compare two vectors of unequal length for equality, you'll get an error. If you do this:
D = ['A','B','C'];
Then that's just going to concatenate them. D is 'ABC'.
Use strcmp(), strcmpi(), ismember() etc for handling string comparison. If you're going to test a lot of cases, you can just avoid all that and do this.
switch mystring
case 'this'
% do a thing
case 'that'
% do a different thing
case {'another','thing'}
% do something else
end

