Hello Every one
Im trying to calculate the entropy for three random values as shown in the following script , but it gives me an error . could any one please help me to find the correct answer. Many thanks.
if true p00=[0.1 0.2 0.3 0.4 0.5 0.6 0.7 ]; p01=[0.1 0.2 0.3 0.4 0.5 0.6 0.7 ]; p02=[0.1 0.2 0.3 0.4 0.5 0.6 0.7 ];for i=1:length(p00) for j=1:length(p01) for k=1:length(p02) p03=1-p00(1,i)-p01(1,j)-p02(1,k) H(i,j,k) = real((-p00(1,i).*log2(p00(1,i))-(p01(1,j)).*log2(p01(1,j))-p02(i,j,k).*log2((p02(i,j,k)))-p03(i,j,k).*log2((p03(i,j,k))))) end endend end
Best Answer