Why does MatLab give non integer values for whole numbers?
Mostrar comentarios más antiguos
I noticed MatLab sometimes gives ridiculous answers to obvious problems. As an example, I gave it a 2x2 matrix and asked it to give me the null.
A = [1 -1; -2 2]
B = null(A)
it prints out that B is [985/1393; 985/1393] or [0.7071; 0.7071] depending on format.
The answer should be B = [1; 1]
Any thoughts on how to fix this? It has become a problem as sometimes the answer has been 0.7071.
AS an example doing QR factorization of A = [-4 -1; 4 0] yields Q = [-0.7071 0.7071; 0.7071 0.7071]
[Q, R] = qr(A)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!