1.Ma trận-định thức
Câu 1a=[1 2 3 4; 3 5 7 2; -2 -3 3 2;1 3 5 4]
a(2,:)=a(2,:)-a(1,:)*3
a(3,:)=a(3,:)+2*a(1,:)
a(4,:)=a(4,:)-a(1,:)
a(4,:)=a(4,:)+a(3,:)*3
a(3,:)=a(3,:)+a(2,:)
a(4,:)=a(4,:)+a(2,:)*4
a(4,:)=a(4,:)-3*a(3,:)
Câu 2:
a=[0 2 -4; -1 -4 5; 3 1 7;0 5 -10];
rank(a)
rank(a*a')
rank(a'*a)
Câu 3:
A=[1 2 1;-1 1 -2] ;
B=[-1 2;0 2;-1 1];
C=[2 1 0;-1 1 1;0 2 -1];
a=2*A*C-(C*B)'
Câu 4:
syms x
a=[1 1 1 1;2 3 -1 4;-1 1 0 2;2 2 3 x];
solve( det(a))
Câu 5: A=[2 3 1;3 4 2;5 3 -1];
Nhóm L12_07
PA=inv(A)*det(A)
Câu 6:
A=[2 1 1;3 1 2; 1 -1 0];
>> I=[1 0 0;0 1 0;0 0 1]
>> f = A^(2)-2*A-3*I
Câu 7: syms a b c x
A=[a+x x x;x x+b x;x x c+x]
det(A)
Câu 8: A=[3 -2 6;5 1 4;3 1 1];
B=[1 1 -1;0 2 5;1 -3 7];
det(2*A*B)
Câu 9: A=[-1 3 2;2 1 0;4 3 1];
det(A^2)
Câu 10: A=[0 -8 3; 1 -5 9; 2 3 8];
B=[-25 23 -30;-36 -2 -26; -16 -26 7];
X=inv(A)*B
2.Hệ phương trình
Câu 1: A=[1 2 3 4; 2 1 2 3;3 2 1 2;4 3 2 1];
B=[1 2 3 4 7;2 1 2 3 6;3 2 1 2 7;4 3 2 1 18];
rank(A)
rank(B)
%r(A)=r(B) = 4=> hệ có nghiệm duy nhất
Câu 2:
A=[1 2 -1;2 3 -3;3 2 5];
A1=[12 2 -1;4 3 -3; -8 2 5];
Nhóm L12_07
A2=[1 12 -1;2 4 -3;3 -8 5];
A3=[1 2 12;2 3 4;3 2 -8];
x1=det(A1)/det(A)
x2=det(A2)/det(A)
x3=det(A3)/det(A)
Câu 3:
syms m
a=[1 3 1 -1;-2 -6 m-1 4; 4 12 3+m^2 m-3]
a(2,:)=a(2,:)+2*a(1,:)
a(3,:)=a(3,:)-4*a(1,:)
a(3,:)=a(3,:)-(m-1)*a(2,:)
%vô nghiệm khi r(a)<r(a/b)=>3-m#0=> m#3
Câu 4: %hệ có nghiệm ko tầm thường khi det(a)=0
syms m
a=[1 2 1;2 1 3;3 3 m]
solve(det(a))
%m=4 thỏa ycbt
Câu 5:
syms m
a=[1 -1 1 2 2;-1 2 2 -2 1;-1 0 1 1 m;2 1-2*m -1 m+2 1]
a(2,:)=a(2,:)+a(1,:)
a(3,:)=a(3,:)+a(1,:)
a(4,:)=a(4,:)-2*a(1,:)
a(:,[2 3])=a(:,[3 2])
a(3,:)=a(3,:)-2/3*a(2,:)
Nhóm L12_07
a(4,:)=a(4,:)+a(2,:)
a(3,:)=-3/5*a(3,:)
a(4,:)=a(4,:)-(4-2*m)*a(3,:)
%để hệ vsn khi r(a)=r(a/b)<4 ẩn
>> solve(a(4,4))
>> solve(a(4,5))
>> subs(a(3,5),m,2)
>> %vay m =2 thi PT co vs n
PHẦN 3 KHÔNG GIAN VECTO
Cau 1
>> M=[1 1 1 0;1 -2 1 1;2 1 2 -1];
>> rank(M)
>> M(2,:)=M(2,:)-M(1,:)
>> M(3,:)=M(3,:)-2*M(1,:)
>> M(3,:)= 3*M(3,:)-M(2,:)
>> %ho con DLLT cuc dai la (1,1,1,0) (0,-3,0,1) (0,0,0,-4)
Cau 2
>> V=[1 2 1 -1;3 1 0 5;0 5 -3 8];
>> rank(A)
>> V(2,:)=V(2,:)-3*V(1,:)
>> V(3,:)=V(3,:)+V(2,:)
Cau 3
>> V=[1 1 -1 0;2 0 -1 -1] ;
>> A = null(V,'r')
>> A'
Nhóm L12_07
>> rank(A')
>> %dim=2 va co so la (0.5,0.5,1,0) va(0.5,-0.5,0,1)
Cau 4
>> E=[1 1 1; 1 1 0; 1 0 1];
>> x=[1;2;-1];
>> xE=inv(E)*x
Cau 5
>> syms m
>> M=[1 -2 1;3 1 -1;m 0 1];
>> %de M la co so thi so chieu bang 3 va DLTT
>> det(M)
>> %M muon DLTT thi detM#0 nen m#-7
Cau 6
>> E=[1 1 1;1 0 1;1 1 0] ;
>> F=[1 1 2;1 2 1;1 1 1] ;
>> A=E^(-1)*F
>> %A la ma tran chuyen co so tu E sang F
>> B = A^(-1)
%B la ma tran chuyen co so tu F sang E
Cau 7
>> syms m
>> M=[1 1 1;2 3 1] ;
>> rank(M)
>> x=[1 0 m] ;
Nhóm L12_07
>> K=[M' x']
>> det(K)
>> %DE THOA THI m=2
Cau 8
syms m
>> V=[1 2 1;3 2 -1;0 2 -1] ;
>> x=[-3 5 m] ;
>> rank(V)
>> K=[V' x']
>> K(2,:)=K(2,:)-2*K(1,:)
>> K(3,:)=K(3,:)-K(1,:)
>> K(3,:)=K(3,:)-K(2,:)
>> %De pt co nghiem(x thuoc V) thi m # 8
Cau 9
>> V =[1 2 1 1;2 1 0 -2;] ;
>> syms m
>> U=[1 5 3 5;3 0 -1 m] ;
>> K=[V' U(1,:)']
>> rref(K)
%v thuoc u
>> Q = [V' U(2,:)']
>> Q(2,:)=Q(2,:)-2*Q(1,:)
>> Q(3,:)=Q(3,:)-Q(1,:)
>> Q(4,:)=Q(4,:)-Q(1,:)
>> %de v thuoc u thi m - 3 = -8 nen m = -5
Nhóm L12_07
Cau 10
>> syms m
>> K=[1 2 1 0;2 1 0 -2;1 5 3 5;3 0 -1 m]
>> rank(K)
>> % HANG CUA U+V LUON =3 VOI MOI m
PHẦN 4 KHÔNG GIAN EUCLIDE
4.1
buvuonggoccuaV=[ 1 -1 1 0; 0 1 1 1];
>>coso=rref(buvuonggoccuaV)
>>dim=size(coso,1)
4.2
u=[ 1 1 2] ;
v=[2 1 -1];
>> d = norm(u-v)
t=[u;v];
>> null(t,'r')'
4.3
>> V=[2 -1 1 0; -2 1 0 1]';
>> x=[ 1 1 0 1]';
>> PrVx=V*inv(V'*V)*V'*x
PrVx=
0.1818
-0.0909
0.5455
Nhóm L12_07
4.4
>> A=[1 0 -1;0 2 0; -1 0 3];
>> u=[ 1 1 2];
>> v=[2 1 -1];
>> w=u-v;
>> goc=acos((u*A*v')/(norm(u)*norm(v)))
>> khoangcach=sqrt(w*A*w')
4.5
>> A=[ 1 0 -2; 0 2 0; -2 0 5];
f=[ 1 2 3];
>> cskgb = null(f*A,'r')
PHẦN 5: ÁNH XẠ TUYẾN TÍNH
5.1
>> f=[ 2 1 -3; 1 -4 0];
>> Coso=null(f,'r')
>> dimkerf =size(Coso,2)
>> coso= rref(f)
>> dim=size(coso,1)
5.2
>> E=[1 1 1 ; 1 1 0; 0 1 1 ];
>> X=[2 0 3 ]';
>> A=E^(-1)*X;
>> F=[2 1 -1 ;-1 2 1 ];
>> f=F*A
5.3
Nhóm L12_07
>> E=[1 1 0; 1 1 1; 1 0 1]';
>> F=[1 1; 2 1]';
>> A=[ 2 1 -3; 0 3 4];
>> x=[1, 2, 3]';
>> fo = F*A*inv(E)*x
Câu6
>> syms x
>> A=[3 4 ; 6 5 ];
>> I=eye(2);
>> B=A-x*I;
>> C=det(B);
>> solve(C)
>> %-1 la tri rieng cua A
Câu 7
>> syms x
>> A=[3 1 1 ;2 4 2 ;1 1 3];
>> I=eye(3);
>> B=A-x*I;
>> C=det(B);
>> solve(C,x)
>> B1=A-2*I;
>> null(B1,'r')
>> B2=A-6*I;
>> null(B2,'r')
Câu 8
Nhóm L12_07
>> syms m
A=[0 -8 6; -1 -8 7;1 -14 m];
>> B = A-2*I;
>> m=solve(det(B),m)
>> C=[0 -8 6; -1 -8 7;1 -14 11];
>> syms x
>> H=C-x*I;
>> F=det(H);
>> solve(F,x)
>> D1=C-(-2)*I;
>> null(D1,'r')
>> null((C-2*I),'r')
>> null((C-3*I),'r')
Câu 9
>> E=[1 2 1 ;1 1 2;1 1 1]';
>> A=[1 0 1 ; 2 1 4 ;1 1 3];
M=E*A*E^(-1)
F=[1 1 1;1 0 1;1 1 0];
N=inv(F)*E*A*inv(E)*F
Câu 10
>> E=[1 1 1; 1 0 1 ;1 1 0]
>> A=[1 1 -1;2 3 3 ;1 2 4 ]
>> M=E*A*inv(E)
>> coso=null(M,'r')'
>> dimkerf= 3-ndims(M)
Nhóm L12_07
>> f1=E*A*E(1,:)';
>> f2=E*A* E(2,:)';
>> f3=E*A* E(3,:)';
>> H=[f1,f2,f3 ]
>> D=rref(H)
>> dimimf = rank(D)
Câu 4
>> f = [1 1 0;0 1 1;1 0 1];
>> x = [1 2 3];
>> K =[f' x'];
>> rref(K)
>> %vay x = (0,2 1)
Câu 5
>> A = [1 6; 5 2];
>> syms x
>> I = eye(2);
>> solve(det(A-x*I))
>> null(A-7*I,'r')
>> null(A+4*I,'r')
>> %vay (8,-5) la VTR cua A
Nhóm L12_07