How to have Matlab create a random matrix that is fullrow rank?
Mostrar comentarios más antiguos
Say we have random matrix A, which we use for proving some theory, and we need this matrix to be fullrow rank, how to model this in Matlab?
I have no numeric values, as I want to research the generality of the theory.
2 comentarios
jessupj
el 24 de Mzo. de 2022
can you clarify what you mean by 'random' here? Requiring a rank imposes some constraint (e.g noncollinearity or something like that) on the entries, so they will coordinate with one another rather than being independent. I think this may be one of those things that you have to think out a strategy on paper first before trying to assemble it numerically.
DB
el 25 de Mzo. de 2022
Respuesta aceptada
Más respuestas (1)
Bruno Luong
el 29 de Mzo. de 2022
Editada: Bruno Luong
el 29 de Mzo. de 2022
Here is a way to generate finite condition number matrxix , meaning stronger than full rank, and it must give a full rank (unless randn(n) returns all 0s)
targetcond = 10; % must be > 1
n = 1000;
[U,S,V] = svd(randn(n,n), 0, 'vector');
Sc = ((targetcond-1)*S + S(1))/targetcond;
A = U*diag(Sc)*V';
% Check
cond(A)
1 comentario
Bruno Luong
el 29 de Mzo. de 2022
it is also possible to make targetcond random but bounded
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
