solving linear systems of equations
i want to solve the following linear systems:
a)
2y+3x-7z=6
3z+5x-y=10
-4x+y+z=4
b)
2y+3x-7z=6
3z+5x-y=10
-4y-6x+14z=-12
i wrote the following code:
clc
clear
A=[3 2 -7; 5 -1 3; -4 1 1]
B=[6;10;4]
%Ax=B, therefore x=B/A
x=B./A
x=linsolve(A,B)
C=[3 2 -7;5 -1 3;-6 -4 14]
D=[6;10;-12]
%if Cx=D, therefore x=D/C
x=D./C
x=linsolve(C,D)
and it works for the first but not the second, this comes up in the command window anyone know why?
Warning: Matrix is singular to working precision.
> In q8_2 (line 15)
x =
NaN
NaN
NaNi want to solve the following linear systems:
a)
2y+3x-7z=6
3z+5x-y=10
-4x+y+z=4
b)
2y+3x-7z=6
3z+5x-y=10
-4y-6x+14z=-12
i wrote the following code:
clc
clear
A=[3 2 -7; 5 -1 3; -4 1 1]
B=[6;10;4]
%Ax=B, therefore x=B/A
x=B./A
x=linsolve(A,B)
C=[3 2 -7;5 -1 3;-6 -4 14]
D=[6;10;-12]
%if Cx=D, therefore x=D/C
x=D./C
x=linsolve(C,D)
and it works for the first but not the second, this comes up in the command window anyone know why?
Warning: Matrix is singular to working precision.
> In q8_2 (line 15)
x =
NaN
NaN
NaN i want to solve the following linear systems:
a)
2y+3x-7z=6
3z+5x-y=10
-4x+y+z=4
b)
2y+3x-7z=6
3z+5x-y=10
-4y-6x+14z=-12
i wrote the following code:
clc
clear
A=[3 2 -7; 5 -1 3; -4 1 1]
B=[6;10;4]
%Ax=B, therefore x=B/A
x=B./A
x=linsolve(A,B)
C=[3 2 -7;5 -1 3;-6 -4 14]
D=[6;10;-12]
%if Cx=D, therefore x=D/C
x=D./C
x=linsolve(C,D)
and it works for the first but not the second, this comes up in the command window anyone know why?
Warning: Matrix is singular to working precision.
> In q8_2 (line 15)
x =
NaN
NaN
NaN linear systems MATLAB Answers — New Questions