- 44
- 0
- 约1.4万字
- 约 37页
- 2017-05-21 发布于浙江
- 举报
数值方法实验报告_matlab实现
注:本实验报告所用教材为:数值计算引论/白峰杉.—2版.—北京:高等教育出版社,2010.1. (所引原题有的只列页码不抄题)
第1章 Matlab介绍
p23.1、
Matlab语句:
[1 2]*[3 4]
Error using *
Inner matrix dimensions must agree.
[1 2].*[3 4]
ans =
3 8
[1 2]*[3 4]
ans =
11
[1 2]*[3 4]
ans =
3 4
6 8
2^[3 4]
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
2.^[3 4]
ans =
8 16
[1 2].^[3 4]
ans =
1 16
x=-1:0.1:1
x =
Columns 1 through 6
-1.0000 -0.9000 -0.8000 -0.7000 -0.6000 -0.5000
Columns 7 through 12
-0.4000 -0.3000 -0.2000 -0.1000 0 0.1000
Columns 13 through 18
0.2000 0.3000 0.4000 0.5000 0.6000 0.7000
Columns 19 through 21
0.8000 0.9000 1.0000
sqrt(x)
ans =
Columns 1 through 3
0 + 1.0000i 0 + 0.9487i 0 + 0.8944i
Columns 4 through 6
0 + 0.8367i 0 + 0.7746i 0 + 0.7071i
Columns 7 through 9
0 + 0.6325i 0 + 0.5477i 0 + 0.4472i
Columns 10 through 12
0 + 0.3162i 0 0.3162
Columns 13 through 15
0.4472 0.5477 0.6325
Columns 16 through 18
0.7071 0.7746 0.8367
Columns 19 through 21
0.8944 0.9487 1.0000
sin(x)
ans =
Columns 1 through 5
-0.8415 -0.7833 -0.7174 -0.6442 -0.5646
Columns 6 through 10
-0.4794 -0.3894 -0.2955 -0.1987 -0.0998
Columns 11 through 15
0 0.0998 0.1987 0.2955 0.3894
Columns 16 through 20
0.4794 0.5646 0.6442 0.7174 0.7833
Column 21
0.8415
cos(x)
ans =
Columns 1 through 5
0.5403 0.6216 0.6967 0.7648 0.8253
Columns 6 through 10
0.8776 0.9211 0.9553 0.9801 0.9950
Columns 11 through 15
1.0000 0.9950 0.9801 0.9553 0.9211
Columns 16 through 20
0.8776 0.8253 0.7648 0.6967 0.6216
Column 21
0.5403
x.^3
ans =
Columns 1 through 5
-1.0000 -0.7290 -0.5120 -0.3430 -0.2160
Columns 6 through 10
-0.1250 -0.0640 -0.0270 -0.0080 -0.0010
Colu
原创力文档

文档评论(0)