Borrar filtros
Borrar filtros

Problems with mldivide,\

5 visualizaciones (últimos 30 días)
Aj
Aj el 29 de Oct. de 2019
Comentada: Walter Roberson el 29 de Oct. de 2019
Hello guys,
i have a A*x= B equation and filled my matrices with random numbers.
I used \ to get the results for x.
But when i use the calculated x to multiplicate with A, the result should be the matrix of B. In B and C are different matrices, which i dont understand.
Do i have any mistakes here?
A=rand(183,4);
B=rand(183,1);
x=A\B;
C=A*x;

Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Oct. de 2019
Your system is over-determined. mldivide is going to do a least-squared fitting. The reconstruction should not be expected to be the same as the original data (not unless the original data can be explained in 4 or fewer linear terms.)
  2 comentarios
Aj
Aj el 29 de Oct. de 2019
Thanks for the answer!
How can i fix this? Is there an alternative to mldivide?
Walter Roberson
Walter Roberson el 29 de Oct. de 2019
You cannot fix this. You are asking to explain 183 or more independent values with only 4 coefficients.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Linear Algebra en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by