-1

I have a cell array of such:

data{1}.field1 = [1 2 3 4 5 6];
data{2}.field1 = [7 8 9 10];
...

data{1}.field2 = {[1 2 3]; [4 5 6]};
data{2}.field2 = {[7 8 9]};
...

I there a simple trick to convert that so I have:

field1 = {[1 2 3 4 5 6], [7 8 9 10], ...}
field2 = {{[1 2 3];[4 5 6]},  {[7 8 9]}, ...}
gregswiss
  • 1,456
  • 9
  • 20

1 Answers1

0

Ok I've found a solution that seem to work

tmp = [data{:}]; 
field1 = {tmp.field1}; 
field2 = {tmp.field2};`
gregswiss
  • 1,456
  • 9
  • 20