MATLAB: Converting cell array to matrix

cell arraycell2matcoordinates

Hi,
I have a 1×650 cell array (centroid1) which contains two values, an x and y coordinate in a (1,2) matrix. How do I convert this cell array into a (:,2) matrix containing the relevant coordinates in each row?
Below is my attempt, but this converts the cell array wih just 1 row.
coord = cell2mat(centroid1)
Thanks

Best Answer

Use vertcat()
coord = vertcat(centroid1{:})
following should also work
coord = cell2mat(centroid1.')