Hi,
When i run the code, i get this warning
Matrix is singular, close to singular or badly scaled. Results may be inaccurate.RCOND = NaN.
and the rest matrices v,var have inf values.
The matrix where i take this warning is 9×9. I attach part of the code to see better where is my fault.
for i=1:num_exp, distance_hat=distance.*10.^(0.05*sqrt(sigma)*randn(1,N)); m = 2.3026*log10(distance_hat); var = exp(4*m)*(exp(8*sigma.^2)-exp(4*sigma.^2)); v = var(1,1)+var(1,2:N); S = eye(N-1).*diag(v) + ~eye(N-1).*var(1,1) S12 = inv(S) sol = loc(x,distance_hat,S12); weighted = loc(x,distance_hat,S12); end
what should i change to not take this warning?
Best Answer