MATLAB: Reading data from cell array

cell arraysMATLAB

I have a cell array that contains all the data. A{1,1}, A{2,1},…A{37,1}.
Now, I want to extract the first row from A{1,1}, A{2,1},…A{37,1} and then combine all the 37 rows in one mat file. How can I do that?

Best Answer

C = cell2mat(cellfun(@(x) x(1,:), A, 'un',0));
save mymat.mat C