I have this following loop for a code (that computes the histograms). I am writing in Matlab. As I am new to Matlab I don't know of any faster methods to do this. I am currently writing
for i=1:size(b)
a(b(i)) = a(b(i)) + 1;
end
Are there any faster methods to do this, preferably those which do not require the for loop?
sizeisn't the right function for what you are doing now, rather use length or numel.