The CELLSTR function in MATLAB 7.0 (R14) and later versions does not automatically deblank a string as it did in MATLAB 6.5.1 (R13SP1).
Under MATLAB 6.5.1 (R13SP1), the STRCMPI function in the following code returns a logical 1. However, under MATLAB 7.0 (R14), STRCMPI will return a logical 0 due to this change.
w = [84, 69, 67, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];x = char(w); % (1x16) char array of 'TECH'
y = cellstr(x);z = y{1}; % (1x4) char array in MATLAB 6.5.1, (1x16) char array in MATLAB 7.0
strcmpi('TECH', z) % 1 in MATLAB 6.5.1, 0 in MATLAB 7.0
Best Answer