Extracting elements from cell array of matrices

조회 수: 3 (최근 30일)
Hau Kit Yong
Hau Kit Yong 2018년 10월 16일
댓글: madhan ravi 2018년 10월 16일
Say I have a 101x101 cell array, where each element is a 3x3 matrix. How can I extract the (1,1) element of each of the 101x101 matrices in the cell array, to form a 101x101 matrix of values?
Edit: I've managed to extract the data using the line as follows:
arrayfun(@(x)x{:}(1,1),mycellarray)

답변 (1개)

madhan ravi
madhan ravi 2018년 10월 16일
편집: madhan ravi 2018년 10월 16일
matrix{1,1}
You can convert the whole matrix to matrix values as such :
cell2mat(matrix) %assuming matrix contains doubles

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by