Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

share|improve this question
    
I am sorry I don't know how to insert hyperlink. I am giving here arxiv.org/pdf/1102.1845.pdf –  srijan Sep 18 '12 at 13:12
    
I think the question has a little problem. Singular matrices have at least one singular value equals zero. –  Seyhmus Güngören Sep 18 '12 at 14:23

1 Answer 1

up vote 3 down vote accepted

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

share|improve this answer
    
Thanks dear it is really helpful to me. I have few queries please clarify me. I didn't get this : CondNumb=10*sqrt(2). Also how to modify the matrix with the singular vectors. I am sorry for my silly question. –  srijan Sep 18 '12 at 15:46
1  
You are welcome! CondNumb=10*sqrt(2) is just an example. For instance, if you want a condition number of 1000, you have to set CondNumb=1000. Regarding the modification of the matrix with the singular vectors, it was an error. I was refering to the matrix of singular values S. Modifying the orifinal matrix S with the instruction S=diag(linspace(CondNumb,1,N)), allows you to change the condition number. Hope this helps –  Fernando Domene Sep 19 '12 at 9:07
    
Thanks for your answer. Your suggested method is working for square matrices but I want to use that for rectangular matrices. Whenever I am running the code it is showing error for S. Error is matrix dimension is not agree. I am unable to aplly proper code to make it rectangular. This is my last question from you. Please help me. –  srijan Sep 19 '12 at 23:37
1  
You are welcome! I edit the original code for rectangular matrices. Hope it helps. –  Fernando Domene Sep 20 '12 at 12:39
    
Thank you very much. This helped me a lot. :) –  srijan Sep 21 '12 at 3:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.