How can I read a set of images in a 1x6 cell array?

조회 수: 2 (최근 30일)
James
James 2019년 9월 10일
댓글: Walter Roberson 2019년 12월 26일
How can I use the imread function ro read a set of images that is in a 1x6 cell array format?

답변 (1개)

Walter Roberson
Walter Roberson 2019년 9월 10일
편집: Walter Roberson 2019년 9월 10일
nfiles = length(YourCellArray);
image_content = cell(nfiles,1);
for K = 1 : nfiles
image_content{K} = imread(YourCellArray{K});
end
Or more simply,
image_content = cellfun(@imread, YourCellArray, 'uniform', 0);
  댓글 수: 7
jenifer Ask
jenifer Ask 2019년 12월 25일
I recive this error:
Index exceeds matrix dimensions.
Walter Roberson
Walter Roberson 2019년 12월 26일
You deleted the code showing how x1 and y1 are created.
We can deduce from the error message that at least one of the x1{i} or y1{i} values is either 1 or 2, or else the last possible value or the last minus 1. Under those circumstances subtracting 2 or adding 2 could be out of range.

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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by