Substitutions —— Solving Systems of Linear Equations using Matlab backslash (用matlab解一元二次方程)

In Matlab, using matrix (backslash in Matlab) slove the linear equations of two unknowns.

0.003*x+59.14*y = 59.17

5.291*x-6.130*y = 46.78

type following: 

>> A=[0.003 59.14; 5.291 6.130];   % 0.003*x+59.14*y = 59.17

>> B=[59.17; 46.78];        % 5.291*x-6.130*y = 46.78

>> C=A\B

C =

  7.6827
  1.0001

 

But actually the answer should be X=10, y=1. So why matlab calculate a wrong result?

posted @ 2019-05-17 14:14  收割稻谷一堆  阅读(350)  评论(0编辑  收藏  举报