Subscript indices must either be real positive integers or logicals.
1 次查看(过去 30 天)
显示 更早的评论
I got this error when i found the mean of a histogram. I have used
[pixelCount grayLevels] = imhist(Im);
meanOriginal = sum(pixelCount .* grayLevels) / sum(pixelCount);
1 个评论
Stephen23
2016-1-30
Have you defined a varibale named sum ?
Please tell us exactly the output of
which sum -all
回答(1 个)
Walter Roberson
2016-1-30
You have probably named a variable sum, interfering with the use of the sum function.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!