数学实验答案-1
- 格式:doc
- 大小:254.50 KB
- 文档页数:11
1.(1)
[1 2 3 4;0 2 -1 1;1 -1 2 5;]+(1/2).*([2 1 4 10;0 -1 2 0;0 2 3 -2]) 2.
A=[3 0 1;-1 2 1;3 4 2],B=[1 0 2;-1 1 1;2 1 1]
X=(B+2*A)/2
3.
A=[-4 -2 0 2 4;-3 -1 1 3 5]
abs(A)>3
4.
A=[-2 3 2 4;1 -2 3 2;3 2 3 4;0 4 -2 5]
det(A),eig(A),rank(A),inv(A)
求计算机高手用matlab解决。
>> A=[-2,3,2,4;1,-2,3,2;3,2,3,4;0,4,-2,5]
求|A|
>> abs(A)
ans =
2 3 2 4
1 2 3 2
3 2 3 4
0 4 2 5
求r(A)
>> rank(A)
ans =
4
求A-1
>> A-1
ans =
-3 2 1 3
0 -3 2 1
2 1 2 3
-1 3 -3 4
求特征值、特征向量
>> [V,D]=eig(A) %返回矩阵A的特征值矩阵D 与特征向量矩阵V
V =
- +
+ - - +
- +
- + - +
D =
+ 0 0 0
0 - 0 0
0 0 + 0
0 0 0 -
将A的第2行与第3列联成一行赋给b
>> b=[A(2,:),A(:,3)']
b =
1 -
2
3 2 2 3 3 -2
1.
a=round(unifrnd(1,100))
i=7;
while i>=0
i=i-1;
b=input('请输入一个介于0到100的数字:');
if b==a
disp('You won!');
break;
else if b>a
disp('High');