[Math] Can we generate random singular matrices with desired condition number using matlab

MATLAB

Recently, I studied A research paper
where author has compared his proposed method with several other existing method on a randomly sigular matrices with fixed condition number. My question is can we generate a random matrices with desired condition number using matlab?

Here is the link of paper: An improved method for the computation of
the Moore-Penrose inverse matrix, table 3

Please clarify my doubt. I would be very much thankful to you.

Best Answer

Matrices in Table 3 are well-known matrices which are close to singular. The condition number is defined as the ratio between the maximal and the minimal singular values. In order to generate a matrix with a desired condition number, you can use SVD decomposition and modify the matrix with the singular values:

nr=4; %Number of rows
nc=5; %Number of columns
CondNumb=10*sqrt(2); %Desired condition number
A=randn(nr,nc);
[U,S,V]=svd(A);
S(S~=0)=linspace(CondNumb,1,min(nr,nc));
A=U*S*V';

Regards, Fernando

Related Question