If I am given the condition number , how can i generate a random matrix with that condition number. The matrix can have any number of rows and columns. please help...
The "condition number" of a matrix, A, is defined as [tex]||A||||A^{-1}|| For symmetric matrices, this is equal to $\displaystyle \frac{\lambda_{max}}{\lambda_{min}}$ where $\displaystyle \lambda_{max}$ is the largest eigenvalue and $\displaystyle \lambda_{min}$ is the smallest.
So the simplest thing to do to take a diagonal matrix with appropriate numbers on the diagonal. For example, if the condition number is to be 3/2, a matrix with that condition number is
$\displaystyle \begin{bmatrix}3 & 0 \\ 0 & 2\end{bmatrix}$.
If you wanted 3 by 3 or 4 by 4 matrices just put numbers between those on the diagonal. To get a non-diagonal matrix (so it looks like you've done more work!) take $\displaystyle A^{-1}DA$ of your diagonal matrix D by some invertible matrix A.