How to extract the data from cell to normal matrix

Hi everybody,
I am looking for an answer to my problem. I have 1x600 cell data which every cell contain 1888x4 matrix. The first column is x, the second is y, the 3rd is u and the 4th is z. I would like to collect all of x column into 1 matrix. In the end, I will have x_collection = 1888x600 matrix.
Does anyone know how to do it? I am a newbie here. Really appreciate your help

 Accepted Answer

all_x = cell2mat( cellfun(@(C) C(:,1), YourCell, 'uniform', 0));

More Answers (1)

cat(3, yourcellarray{:})
will result in a 1888x4x600 matrix, if you prefer the 4 columns to be pages (i.e. a 1888x600x4 matrix):
permute(cat(3, yourcellarray{:}), [1 3 2])

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!