Linear equation minimization problem
Mostrar comentarios más antiguos
Hello,
I have the folowing matrix:
A=[1 1 1
1 1 0
1 0 0
0 1 1
0 0 1];
I need to find a vector b [ x1,x2,x3,x4,x5],
such that the answer will be as close to [4,6,7] (minimization of error between the answer and the achieved goal).
Is there any convient way to do it in matlab?
Respuestas (1)
Alan Stevens
el 29 de Ag. de 2020
Like so:
>> A=[1 1 1
1 1 0
1 0 0
0 1 1
0 0 1]
>> V = [4 6 7]
A =
1 1 1
1 1 0
1 0 0
0 1 1
0 0 1
V =
4 6 7
>> R = V/A
R =
5.0000 -1.0000 0 2.0000 0
>> R*A
ans =
4.0000 6.0000 7.0000
Categorías
Más información sobre Linear Algebra 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!