MATLAB: How can we transpose a row vector into column vector in a cell

arraycell arraysMATLAB

I want to convert a row vector in my defined cell into coulumn vector
A{1} = [1 2 3 4];
A{2} = [5 6 7 8];
I want to convert them into
A{1}=[1;2;3;4];
A{2}=[5;6;7;8];
Can this be done with a simple function

Best Answer

cellfun(@(x) x(:),A,'un',0)