How can I convert a 2xn matrix into a 1xn cell array, concatenating the values upwards so the cell array contains the column vectors of the original matrix? I want to do this more efficiently than a simple for loop going through each column (as this is matlab and loops are inefficient)
Say I had a 2x2 matrix [1,2;3,4]. I wish to convert it into a cell array {[1,3],[2,4]}. I have looked up about mat2cell but can't see how to keep the length of the cell array while concatenating upwards.
Thanks in advance.