MATLAB: Cell2mat of specific coulmns

cell to mat

I have a cell called A, with 6*1 cell, each cell has 8*3 doubles. How I create matrix B with 6*8 size which each column of B includes 3rd column of each cell of A?

Best Answer

A=arrayfun(@(x) randi(10,8,3),1:6,'un',0) % ----Example------
B=cell2mat(cellfun(@(x) x(:,3),A,'un',0))