Manipulating an array of images

1 次查看(过去 30 天)
I have an array of images stored in a 1 by x cell.
I tried to use a for loop to convert them all to BW
for i = 1.array.Count
NewArray{i} = im2bw(array(i))
end
However, I got the error
'Dot indeing is not supported for variables of this type.'
Is there a way around this?

回答(1 个)

Kavya Vuriti
Kavya Vuriti 2020-8-4
编辑:Kavya Vuriti 2020-8-4
Hi,
To access the contents of a cell in a cell array, curly braces({}) must be used. Try using following code:
for i = 1:numel(array)
NewArray{i} = im2bw(array{i});
end
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by