Professional Documents
Culture Documents
glcm = graycomatrix(Imag,'Of',offsets); %calculating gray level co-occurrence matrix glcm [r c] = size(glcm); for ctr=1:1:r for ctr2=1:1:c T(i).energy = T(i).energy+(glcm(ctr,ctr)).^2; end end fprintf('energy is %li\n\n',T(i).energy);
Just a quick comment: your line inside the for-loop never references ctr2, probably typo. You could vectorize both forloops with the simple:
T(i).energy = sum(gclm(:).^2);