Professional Documents
Culture Documents
>> x=linspace(0,2*pi,100)
x=
Columns 1 through 17
0
0.6347
0.0635
0.6981
0.1269
0.7616
0.1904
0.8251
0.2539
0.8885
0.3173
0.9520
0.3808
1.0155
0.4443
0.5077
0.5712
Columns 18 through 34
1.5232
1.5867
1.6501
2.6021
2.6656
2.7291
3.6811
3.7445
3.8080
Columns 35 through 51
Columns 52 through 68
Columns 69 through 85
4.7600
4.8235
4.8869
5.8389
5.9024
5.9659
5.7120
5.7755
>> y=(sin(x)).^2
y=
Columns 1 through 17
0
0.3515
0.0040
0.4132
0.0160
0.4762
0.0358
0.5396
0.0631
0.6024
0.0974
0.6635
0.1381
0.7220
0.1847
0.2364
0.2923
Columns 18 through 34
0.9977
0.9997
0.9937
0.2639
0.2100
0.1607
Columns 35 through 51
Columns 52 through 68
0.2639
0.3216
0.3821
0.9977
0.9877
0.9698
0.2364
0.1847
0.1381
0.0974
0.8153
0.7636
0.7077
0.0023
0.0003
0.0063
Columns 69 through 85
0.2923
>> z=(cos(x)).^2
z=
Columns 1 through 17
Columns 18 through 34
Columns 35 through 51
0.7361
0.7900
0.8393
0.7361
0.6784
0.6179
0.0023
0.0123
0.0302
0.8153
0.8619
0.9026
Columns 52 through 68
Columns 69 through 85
>> plot(y)
>> hold on
>> plot(z,'R')
0.7077
0.7636
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
10
20
30
>>
___________________
cos(x)
___________________
sin(x)
40
50
60
70
80
90
100