How to have Matlab create a random matrix that is fullrow rank?
Ältere Kommentare anzeigen
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 Kommentare
jessupj
am 24 Mär. 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
am 25 Mär. 2022
Akzeptierte Antwort
Weitere Antworten (1)
Bruno Luong
am 29 Mär. 2022
Bearbeitet: Bruno Luong
am 29 Mär. 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 Kommentar
Bruno Luong
am 29 Mär. 2022
it is also possible to make targetcond random but bounded
Kategorien
Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
