MATLAB: Is there a possibility to join the strings out of cells in cells

cell

Dear Matlab-community,
i have many cells in cells, here is a simple example: Testfile = {'String1', 'String2';{'String3';'String4'}, {'String5';'String6'}};
I would like to have somthing like this: first cell: String1.String3,String1.String4 second cell: String2.String5,String2.String6
Is there a fuction, which helps to extract the cell information easier, then looping over all cells?

Best Answer

I think that's what you want. If not as per Jan's comment, use valid matlab syntax to define the desired output

cellfun(@(s, c) compose('%s.%s', s, string(c)), Testfile(1, :), Testfile(2, :), 'UniformOutput', false)

Requires R2016b or later for compose and string.