Speed up for loop, accumarray
Show older comments
I would like to speed up my two for loop with accumarray (I have old version of MatLab and I've read on internet that accumarray will speed up my operation)
if true
for i = 1:size(img, 1)
for j = 1:size(img, 2)
R = idx(i, j, 1);
G = idx(i, j, 2);
B = idx(i, j, 3);
H(R,G,B) = H(R,G,B) + 1;
end
end
end
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Report Generator 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!