%sy1sj.m
A=[3 4 -1 1 -9 10
6 5 0 7 4 -16
1 -4 7 -1 6 -8
2 -4 5 -6 12 -8
-3 6 -7 8 -1 1
8 -4 9 1 3 0];
B=[1 2 4 6 -3 2
7 9 16 -5 8 -7
8 11 20 1 5 5
10 15 28 13 -1 9
12 19 36 25 -7 23
2 4 6 -3 0 5];
b=[1 3 5 7 9 11];
%1.1
X6=B/A
%1.2
Y1=[A,b’];
Y2=rref(Y1);
X7=Y2(:,7)
%1.3
[X8,D]=eig(X6)
%1.4
X9=BBinv(A)inv(A)
%2.1
a1=A(1,:)
a2=A(2,:)
a3=A(3,:)
a4=A(4,:)
a5=A(5,:)
a6=A(6,:)
%2.2
b1=A(:,1)
b2=A(:,2)
b3=A(:,3)
b4=A(:,4)
b5=A(:,5)
b6=A(:,6)
%2.3
A3=A([1 3 5],[2 4 6])
%2.4
E6=eye(6);
Z6=zeros(6);
A4=[A,E6;Z6,B]
%2.5
A5=orth(A)
D=A5’A5
%2.6
A7=a1a2’
%2.7
%一四行互换:
A([1,4],:)=A([4,1]?
%第三列x6:
A(:,3)=6A(:,3)
%第一行1.倍+第五行:
A(5,:)=A(5,:)+10*A(1,:)
%2.8
Y2=rref(B);
A9=[B(:,1),B(:,2),B(:,3),B(:,6)]
disp(‘若用ci表示矩阵B第i列,则:c4=(-6.8)*c1+(-8.6)*c2+(7.5)*c3+(0)*c4 ; c5=(6.2)*c1+(1.4)*c2+(-3)*c3+(0)*c4’)
%2.9
A=[1 2 3;4 5 6;7 8 9];
[L,U]=lu(A)
%2.10
M1=norm(A)
M2=norm(A,inf)
M3=norm(A,1)
M4=norm(A,‘fro’)
C1=cond(A)
C2=cond(A,inf)
matlab 实验二作业 10/10
最新推荐文章于 2023-05-12 12:23:12 发布