How can I read a set of images in a 1x6 cell array?
2 次查看(过去 30 天)
显示 更早的评论
How can I use the imread function ro read a set of images that is in a 1x6 cell array format?
0 个评论
回答(1 个)
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 个评论
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 Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!