I have 26 characters A to Z, I group 4 characters together and separate the following 4 characters by a space which is like this:
abcd efgh ijkl mnop qrst uvwx y
Another approach using regular expressions:
str = 'abcdefghijklmnopqrstuvwxyz'; str = regexprep(str, '(.{4})', '$1 '); str = regexprep(str, '(.{4} .{4}) ', '$1\n');