How to solve "brace indexing is not supported for variables of this type" for this code?
Show older comments
Excerpt of my code is as follows:
s=0;
for k = 1 : length(theFiles)
for q=0.1:0.01:0.3
histgrm=im2bw(maskedRgbImage,q);
num{k}=sum(histgrm(:) == 0);
if(num{k}>400)
number{s}=num{k};
s=s+1;
end
end
end
for s=0:19
fprintf("%d\n",number{s})
end
length(theFiles), histgrm are defined in the original code. But it shows error as:
Unable to perform assignment because brace indexing is not supported for variables of this type.
How can I fix this?
3 Comments
DGM
on 25 May 2021
What is
class(num)
and
class(number)
Tawsif Mostafiz
on 25 May 2021
DGM
on 25 May 2021
then just use
number(s)
instead of
number{s}
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!