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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -