필터 지우기
필터 지우기

Save unlimited matrix from cell arrays

조회 수: 1 (최근 30일)
Rdmato33
Rdmato33 2015년 10월 15일
댓글: Rdmato33 2015년 10월 15일
Hello, I get a cell array which contains 103 cells of different dimensions. Each cell represents a matrix and it can be displayed as an image. How can I extract each matrix in a for loop?
According to an old message published on matlab answers (<http://www.mathworks.com/matlabcentral/answers/36876-how-to-extract-cell-arrays-contained-in-a-cell)>, I know how to do that one by one but not for the whole cell :
image1 = cellArray{1}; % extract matrix 1 (on 103) from the cell array #1
image2 = cellArray{2}; % and so on.
Thanks for your help
  댓글 수: 4
Ced
Ced 2015년 10월 15일
Why not just a simple for loop?
i.e.
n_cols = size(my_array,2); % 103 in your case
for i = 1:n_cols
image = my_array{i};
% do whatever processing you need
end
Rdmato33
Rdmato33 2015년 10월 15일
Ok. Thanks.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by