0

I have multiple files whose data are dispersed throughout the file and when I textscan them into Matlab, I get a cell of cells or strings. For example,

data_in = {'aaaa';'bbbb';{'cccc','dddd','eeee','ffff'};'gggg';{'hhhh','iiii'};'jjjj'}

and so on. In other words;

data_in = {1x1 str;1x1 str;1x4 cell;1x1 str;1x2 cell;1x1 str}

and this can be any combination depending on a data file. My question is how to combine them into 1xn cell? I tried data_in = data_in(:) or data_in{:}, but neither worked. What I want to have is:

data_in = {'aaaa','bbbb','cccc','dddd','eeee','ffff','gggg','hhhh','iiii','jjjj'}
Eric
  • 409
  • 2
  • 15
  • Just note: In the question marked as duplicate of, for you the solution is not the accepted one but the another: `data_in = [data_in{:}];` – DVarga Oct 11 '16 at 06:23
  • @DVarga it worked beautifully. Why then, though, {:} alone didn't work? – Eric Oct 11 '16 at 17:10

0 Answers0