How to find a matrix if i know the 2 norm condition number is 1.
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I understand how to go from a matrix and solve for the 2 norm condition number, but how would I reverse this and find a matrix if I know the 2 norm condition number is 1?
0 comentarios
Respuestas (2)
Steven Lord
el 19 de Oct. de 2016
A = eye(5); c = cond(A)
A = eye(700); c = cond(A)
A = gallery('randcolu', ones(1, 5)); c = cond(A)
Any of these matrices have 2-norm condition number 1 (or very close to 1.) Run that last line a couple times (it uses random numbers) and it should give you plenty of matrices that satisfy the requirement you specified here.
0 comentarios
John D'Errico
el 19 de Oct. de 2016
Editada: John D'Errico
el 20 de Oct. de 2016
Another way to generate random matrices of any size that have a unit condition number:
n = 10;
[Q,R] = qr(rand(n,n));
cond(Q)
ans =
1
The point is, this generates an orthogonal matrix Q. Orthogonal matrices have a condition number of 1, since all of their singular values must be 1.
Test question: If you have a square matrix with all singular values identically equal to 1, MUST the matrix be an orthogonal matrix? :)
Ok, next question, is how do we find a matrix with a different condition number? The trick I showed before was a simple one, because it relies upon a property of an orthogonal matrix. But suppose we wanted a fairly random matrix, that has the property of having exactly a condition number of 17? 17 is such a good number. First, we can construct a couple of arbitrary orthogonal matrices. I used QR before. But ORTH will suffice too.
n = 10;
U = orth(rand(n));
V = orth(rand(n));
S = diag([rand(1,n-2) + 1, 1, 17]);
A17 = U*S*V';
Lets test it. How well did we do?
cond(A17)
ans =
17
The point is, I created the components of what I'll interpret as a singular value decomposition, then constructed A17 from those matrices. Since cond only cares about the largest and smallest singular values, all that matters is the ratio between those two numbers and that the other singular values are strictly in the open interval (1,17).
Now, will the elements of A17, really "look" as if they are truly random numbers?
A17
A17 =
-0.64151 -0.66071 -1.307 0.96006 0.42311 1.7017 1.2199 0.63908 1.2749 -1.9416
0.34721 3.0265 3.6943 -1.7414 0.41062 -2.3703 -3.8064 -1.2752 -2.9945 7.2492
0.81546 -0.93325 -1.696 0.83684 -0.66001 1.658 1.2544 1.4063 1.0196 -2.9824
-0.043155 -0.64973 -0.92772 0.95632 0.17841 0.88252 1.9237 0.38353 0.21162 -1.4819
0.48502 -1.3491 -0.38894 1.0871 0.57536 1.3347 1.1243 0.16144 1.2917 -2.9506
0.43476 -1.3393 -1.0372 0.067204 -0.11186 1.2672 1.6271 0.41893 1.594 -1.6869
-0.061645 -0.94853 -0.84986 1.2225 0.020875 0.3366 1.2813 1.2351 1.4903 -1.7318
0.106 3.1699 3.9391 -2.7023 0.47452 -2.6432 -2.9089 -0.73331 -2.9569 5.8743
0.51397 1.7402 0.46775 -0.41793 0.4076 -0.94409 -0.7941 -0.60781 -0.33629 1.7895
-0.05118 1.1921 1.5338 -0.17396 -0.72866 -0.49513 -0.62276 -0.63417 -0.51139 1.7564
Well, they do have some rather obvious patterns in there. But nobody ever stated that as a goal.
0 comentarios
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!