MATLAB: Concatenating characters in different column to a string

excelstrings

I want to store 1×5 array of strings ['a' 'b' 'c' 'd' 'e'] as a single string of 1×1 :'abcde'. How can I do that? I want to do this because if I export ['a' 'b' 'c' 'd' 'e'] to excel file then they appear in seperate columns. But I want to write them all in same cell.

Best Answer

['a' 'b' 'c' 'd' 'e'] is not a 1 x 5 array of strings: it is a single string of length 5, 'abcde', exactly as you want.
{'a' 'b' 'c' 'd' 'e'} on the other hand would be a 1 x 5 cell array of strings. You can convert this cell array to a single string by using cell2mat()