math - Avoid Generating a singular matrix in MATLAB -
how generate random matrix not singular in matlab.?
i know matrix determinant can used check this, after reading matlab determinant:
"using det(x) == 0 test matrix singularity appropriate matrices of modest order small integer entries. testing singularity using abs(det(x)) <= tolerance not recommended difficult choose correct tolerance. function cond(x) can check singular , singular matrices."
so if want generate big random matrix (axb) a=5000, b=5000, how it??.
a randomly generated matrix full rank (and hence invertible, if square) probability 1:
a = randn(5000);
you can check using min(svd(a))
, , verifying smallest singular value larger zero.
this well-known fact, here's example paper if want one.
Comments
Post a Comment