I have a sparse matrix L of zeros and ones and I want to change the non-zero entries to some fractions. This is my code:
beta = 0.5n = size(L,1); %set n = dim(L)rsv=ones(1,n)*L; %row sum vector of LH =L;for i=1:nfor j=1:nif H(i,j) == 1H(i,j)=1/((1-beta)*rsv(i)+ beta*rsv(j));endendend
I found this code works for the matrix of size 5 but does not work for the matrix of size 100 (all entries stay unchanged).
Do you know why and how to change the code?