I would like to perform a matrix division on two large matrices, A \ b, (e.g., 1000-by-1000 and 1000-by-1). I always get a warning from this operation:Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = XXX

I think the problem is mainly because some elements in A and b have more than 16 digits.

I tried using 'vpa' to increase the precision, but it is super slow for converting a large matrix and the data type is no longer 'double' which would cause some problems later in my algorithm.

Could you please tell me if there is any way to change Matlab default data precision other than using vpa?

(P.S. you might suggest me using Levenberg–Marquardt algorithm to tackle the problem, but I found only a very large damping parameter can remove this warning, which is not very ideal in my case)

1

Best Answer


There is no such thing as 'too many digits' in Matlab matrices. They are stored as 8 byte doubles. Your assumption about the problem is wrong.