3元一次方程2x-y+z=4 2x+3y-z=12 x+y+z=6

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 02:55:23
3元一次方程2x-y+z=42x+3y-z=12x+y+z=63元一次方程2x-y+z=42x+3y-z=12x+y+z=63元一次方程2x-y+z=42x+3y-z=12x+y+z=62x-y+z=

3元一次方程2x-y+z=4 2x+3y-z=12 x+y+z=6
3元一次方程2x-y+z=4 2x+3y-z=12 x+y+z=6

3元一次方程2x-y+z=4 2x+3y-z=12 x+y+z=6
2x-y+z=4 ①
2x+3y-z=12 ②
x+y+z=6 ③
①+②,得4x+2y=16,则2x+y=8④
②+③,得3x+4y=18⑤
④×4-⑤,得8x-3x=32-18,解得x=2.8
代入④,得y=2.4
代入①,得z=0.8

x=4.8
y=0.9
z=0.3

x=14/5
y=12/5
z=4/5

用MATLAB直接解
>> s=solve('x+y+z=1','x+2*y+z=2','x+y-z=6','x,y,z');
>> result=[s.x,s.y,s.z]

result =

[ 5/2, 1, -5/2]