function result1=cosine(edgehistogram,my_size)
result1=0;
result=0;
for i=3:my_size
    
    for j=3:i-1
     
        result(i,j)=1-sum(edgehistogram{i}.*edgehistogram{j})/(sqrt(sum(power(edgehistogram{i},2)))*sqrt(sum(power(edgehistogram{j},2))));
    end
    for j=i+1:my_size
       
        result(i,j)=1-sum(edgehistogram{i}.*edgehistogram{j})/(sqrt(sum(power(edgehistogram{i},2)))*sqrt(sum(power(edgehistogram{j},2))));
    
    end
end

result1=result;