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 个)

Walter Roberson
Walter Roberson 2016-1-30
You have probably named a variable sum, interfering with the use of the sum function.

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by