1.在Command Window里面计算
(1); >>(3+5+8)/5*10 ans=32
(2); >>sin(3*pi)/sqrt(9/5) ans=2.7384e-16
(3),,计算:;
>> a=[1 2 3;4 5 6;7 8 9];
>> b=[7 8 9;4 5 6;1 2 3];
>> c=a*b
c =
18 24 30
54 69 84
90 114 138
>> d=a+b
d =
8 10 12
8 10 12
8 10 12
>> e=a\c
e =
34.0000 22.0000 62.0000
-50.0000 -23.0000 -100.0000
28.0000 16.0000 56.0000
>> f=c/b
f =
NaN NaN NaN
NaN -Inf Inf
NaN NaN NaN
(4),求;(求矩阵的行列式)
>> a=[3 1.2 4;7.5 6.6 3.1;5.4 3.4 6.1];
>> a'
ans =
3.0000 7.5000 5.4000
1.2000 6.6000 3.4000
4.0000 3.1000 6.1000
>> inv(c)
c =
2.1555 0.4555 -1.6449
-2.1040 -0.2393 1.5013
-0.7354 -0.2698 0.7833
>> det(a)
ans =
13.7880
(5),输入复数矩阵;
>> z=[1+2*i 3+4*i;5+6*i 7+8*i] or>>z=[1 3;5 7]+[2 4;6 8]i
z =
1.0000 + 2.0000i 3.0000 + 4.0000i
5.0000 + 6.0000i 7.0000 + 8.0000i
2.建立.m文件,用for循环语句生成5×5的矩阵A:,将A矩阵进行水平和垂直翻转得到矩阵B和C。将A矩阵的前3行,3列变成0并赋值给D。
>> a=zeros(5);
for m=1:5
for n=1:5
a(m,n)=m+n-1
end
end
a =
1 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 0 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 0 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 5 0 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 0
0 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
0 0 0 0 0
matlab求傅里叶变换 0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 0 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 5 0 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 5 6 0 0
0 0 0 0 0
a =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 5 6 7 0
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论