- 6
- 0
- 约8.32万字
- 约 19页
- 2017-01-03 发布于贵州
- 举报
Using Toolbox Path Cache. Type help toolbox_path_cache for more info.
To get started, select MATLAB Help from the Help menu.
7.1.1MATLAB语言平台
练习MATLAB命令的基本操作
1)常数矩阵输入
a=[1 2 3]
a =
1 2 3
a=[1;2;3]
a =
1
2
3
b=[1 2 5]
b =
1 2 5
b=[1 2 5];
a
a =
1
2
3
a
ans =
1 2 3
b
b =
1 2 5
b
ans =
1
2
5
c=a*b
c =
1 2 5
2 4 10
3 6 15
c=a*b
??? Error using == *
Inner matrix dimensions must agree.
a=[1 2 3;4 5 6;7 8 0]
a =
1 2 3
4 5 6
7 8 0
a^2
ans =
30 36 15
66 81 42
39 54 69
a^0.5
ans =
0.5977 + 0.7678i 0.7519 + 0.0979i 0.5200 - 0.4680i
1.4102 + 0.1013i 1.7741 + 0.6326i 1.2271 - 0.7467i
1.2757 - 1.0289i 1.6049 - 1.0272i 1.1100 + 1.6175i
2)作循环命令程序
makesum=0;
for i=1:1:100
makesum=makesum+i;
end
makesum
makesum =
5050
3)分别执行下列命令
. a=[1 2 3;4 5 6;7 8 0]
a =
1 2 3
4 5 6
7 8 0
poly(a)
ans =
1.0000 -6.0000 -72.0000 -27.0000
rank(a)
ans =
3
det(a)
ans =
27
trace(a)
ans =
6
inv(a)
ans =
-1.7778 0.8889 -0.1111
1.5556 -0.7778 0.2222
-0.1111 0.2222 -0.1111
eig(a)
ans =
12.1229
-0.3884
-5.7345
help help
HELP On-line help, display text at command line.
HELP, by itself, lists all primary help topics. Each primary topic
corresponds to a directory name on the MATLABPATH.
HELP TOPIC gives help on the specified topic. The topic can be a
command name, a directory name, or a MATLABPATH relative partial
pathname (see HELP PARTIALPATH). If it is a command name, HELP
displays information on that command. If it is a directory name,
HELP displays the Table-Of-Contents for the specified directory.
原创力文档

文档评论(0)