How do I find the (right) null space of a matrix?

74 Ansichten (letzte 30 Tage)
Fernando Arias
Fernando Arias am 3 Mai 2023
Hi everyone.
I am trying to find the (Right) null space of a matrix - Aptech-Gauss' style - but the command "null" does not result in the same answer. How do I yield the same null space? I do not have Gauss, I am working only in Matlab. Thank you

Antworten (1)

John D'Errico
John D'Errico am 3 Mai 2023
Bearbeitet: John D'Errico am 3 Mai 2023
Easy.
A = rand(5,2)*rand(2,3)
A = 5×3
0.3371 0.5465 0.1893 0.2793 0.6953 0.1563 0.3790 0.5695 0.2130 0.3455 0.6836 0.1937 0.2921 0.5538 0.1639
A has rank 2.
Arnull = null(A)
Arnull = 3×1
0.4926 -0.0023 -0.8702
A*Arnull
ans = 5×1
1.0e-15 * -0.0833 -0.0555 -0.1110 -0.0555 -0.0555
It kills A, which is what the right nullspace would do. The left nullspace is also easy.
Alnull = null(A')'
Alnull = 3×5
0.8310 0.0214 -0.5194 -0.1405 -0.1392 -0.0531 -0.4411 -0.2969 0.8365 -0.1210 -0.0574 -0.2853 -0.3075 -0.1336 0.8960
Alnull*A
ans = 3×3
1.0e-15 * -0.2151 -0.0416 -0.1214 0.0486 0.0555 -0.0104 0 -0.0555 0
Again, only floating point crap remains.
Maybe your real question is the answer is not the same. But, do you understand that the nullspace need not be unique? You can always scale the nullspace vectors by any constant, and they are still valid nullspace vectors. And if there is more than 1 nullspace dimension, then linear combinations of the nullspace vectors are equally valid.
  1 Kommentar
Fernando Arias
Fernando Arias am 4 Mai 2023
Thank you John for your answer. I kept working on the issue using "null" and, as you say, I was asking the wrong question. Now, my real question is: how do I set the "tol" option in the null command, so I can work on the appropiate null space?. For example, if I do not set the "tol" option to a specific number, the null space of a 7x9 matrix is a matrix of 9 x 6. If I instead use 0 as my tolerance, for the same matrix I get a matrix of 9 x 3.
Since in Gauss I do not need to provide a tolerance value, I guess that is the reason why I am getting different matrices' dimensions for null spaces. Therefore, my question is: what would be the appropiate conditions to set a value for the "tol" option in the null procedure?
Many thanks again for your accurate and prompt response to my previous question.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by