MATLAB: How to extract element of all matrices within a cell array using cellfun

cell arraycellfunhandlesloop

I need to extract (2,1) i.e. second row and first column element of all matrices within cell array ?

Best Answer

Are all the matrices in the cells the same size? If so, just use cell2mat() and indexing:
[rows, columns] = size(ca{1})
m = cell2mat(ca)
m21 = m(2:rows:end, 1:columns:end)