There are 3 methods stated as follows:
Let the string be
S = 'asdffdsaasdf'
The first method is to decompose the string into individual cells, then join them via strjoin with spaces:
str = mat2cell(S, 1, 2*ones(1,numel(S)/2));
outStr = strjoin(str, ' ');
In second method you can use regular expressions to count up exactly 2 characters per token, then insert a space at the end of each token, and trim out any white space at the end if there happen to be spaces at the end:
outStr = strtrim(regexprep(S, '.{2}', '$0 '));
In third method you can reshape your character matrix so that each pair of characters is a column, you would insert another row full of spaces, then reshape back. Also trim out any unnecessary whitespace:
str = reshape(S, 2, []);
str(3,:) = 32*ones(1,size(str,2));
outStr = strtrim(str(:).');