Effacer les filtres
Effacer les filtres

To solve non-linear equation by inversion notion

2 vues (au cours des 30 derniers jours)
sookyung Kang
sookyung Kang le 3 Juil 2020
Commenté : sookyung Kang le 6 Juil 2020
I'd like to know how to solve an inversion equation from n x n matrix in AX=B to obtain X.
A=n x n, X=n x 1, B=n x n.
I used X=inv(A)*B but I got "Matrix must be square."
Is there anyone solve it?

Réponses (1)

John D'Errico
John D'Errico le 3 Juil 2020
Modifié(e) : John D'Errico le 3 Juil 2020
STOP.
Is this nonlinear? Or is it linear? A*X = b is still LINEAR, even if the array is not square.
Even in the linear case, thus A*X = b, even if the matrix is not square, you should never be using inv anyway.
x = A\b;
solves the problem in MATLAB. If the matrix A is rank deficient, then you can use tools like
x = pinv(A)*b;
or
x = lsqminnorm(A,b);
HOWEVER, if this truly is nonlinear? Then you have some problem in the form of a nonlinear regression, where you need to use tools like lsqnonlin or lsqcurvefit. So in either case, there exist tools to solve the problem (NONE of them should ever be inv) but you need to know which problem you want to solve. At least, you need to explain to someone clearly what problem you want to solve.
One thing you can only very rarely do, if your problem is of the form
f(x) == y
for a nonlinear function f, is to solve it by computing an inverse function that might be thought of as inv(f).
  1 commentaire
sookyung Kang
sookyung Kang le 6 Juil 2020
Yes because I didn't put real equations for A and B parts. So
Ff(x) == y
inv(f) is enough to solve non-linear matrix equation?
Thanks for your answer.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Systems of Nonlinear Equations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by