Linear Equations infinite solutions parametric form

6 visualizaciones (últimos 30 días)
Virendrasingh Pawar
Virendrasingh Pawar el 17 de Sept. de 2021
Comentada: Virendrasingh Pawar el 17 de Sept. de 2021
Hi,
I am trying to solve a system of the form Ax = b which has infinte many solutions:
for eg: 2x+y = 3; 4x+2y = 6
I want Matlab to return the solution in paramtric form: sol = (3-y/2, y)^T, something like this.
I there a method to achieve this easily without writing a complicated script?
Thanks in advance.
  2 comentarios
Bjorn Gustavsson
Bjorn Gustavsson el 17 de Sept. de 2021
How big and how underdetermined are(is?) your system of equations? The answer depends crucially on this. For the general case you'll have to accept a small bit of (great and beautiful) linear algebra, but that might be beyond what you need...
Virendrasingh Pawar
Virendrasingh Pawar el 17 de Sept. de 2021
It's a homework problem, small size cases (3*5 or 5*5 atmost). I am hoping for Matlab to retun the solution in paramteric form, can this be done? Thanks.

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 17 de Sept. de 2021
x0=pinv(A)*b;
B=null(A);
sol=@(c)x0+B*c;

Más respuestas (0)

Categorías

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

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by