0% found this document useful (0 votes)
26 views4 pages

Aplicatia 3

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

Aplicatia nr 3.

Musetescu Robert George


>> x=[0:pi/12:2*pi]

x =

Columns 1 through 10

0 0.2618 0.5236 0.7854 1.0472 1.3090 1.5708 1.8326


2.0944 2.3562

Columns 11 through 20

2.6180 2.8798 3.1416 3.4034 3.6652 3.9270 4.1888 4.4506


4.7124 4.9742

Columns 21 through 25

5.2360 5.4978 5.7596 6.0214 6.2832

>> f=cos(2*x)

f =

Columns 1 through 10

1.0000 0.8660 0.5000 0.0000 -0.5000 -0.8660 -1.0000 -0.8660


-0.5000 -0.0000

Columns 11 through 20

0.5000 0.8660 1.0000 0.8660 0.5000 0.0000 -0.5000 -0.8660


-1.0000 -0.8660

Columns 21 through 25

-0.5000 -0.0000 0.5000 0.8660 1.0000


>> plot (f)
>> plot(x,f)
aplicatia 3:
>> x[1:10]
>> f=sin(x)-sqrt(x)+2;
>> plot(f)
%punctul b%
>>y=[-10:10]
>> g=sin(y)-cos(y).*sqrt(y)
>> plot(g)
>>hold on
>> y=[-5:5]

y =

-5 -4 -3 -2 -1 0 1 2 3 4 5

>> gi=sin(y)-cos(y).*sqrt(y)
gi =

Columns 1 through 5

0.9589 - 0.6343i 0.7568 + 1.3073i -0.1411 + 1.7147i -0.9093 + 0.5885i


-0.8415 - 0.5403i

Columns 6 through 10

0.0000 + 0.0000i 0.3012 + 0.0000i 1.4978 + 0.0000i 1.8558 + 0.0000i


0.5505 + 0.0000i

Column 11

-1.5932 + 0.0000i

>> plot(gi,'g')
>> %ex2%
>> t=[0:pi/12:2*pi]

t =

Columns 1 through 10

0 0.2618 0.5236 0.7854 1.0472 1.3090 1.5708 1.8326


2.0944 2.3562

Columns 11 through 20

2.6180 2.8798 3.1416 3.4034 3.6652 3.9270 4.1888 4.4506


4.7124 4.9742

Columns 21 through 25

5.2360 5.4978 5.7596 6.0214 6.2832

>> x=r*(t-sin(t))

x =

Columns 1 through 10

0 0.0209 0.1652 0.5480 1.2682 2.4015 3.9956 6.0667


8.5986 11.5436

Columns 11 through 20

14.8260 18.3468 21.9911 25.6355 29.1563 32.4387 35.3837 37.9156


39.9867 41.5808

Columns 21 through 25

42.7141 43.4343 43.8171 43.9614 43.9823


>> y=r*(1-cos(t))

y =

Columns 1 through 10

0 0.2385 0.9378 2.0503 3.5000 5.1883 7.0000 8.8117


10.5000 11.9497

Columns 11 through 20

13.0622 13.7615 14.0000 13.7615 13.0622 11.9497 10.5000 8.8117


7.0000 5.1883

Columns 21 through 25

3.5000 2.0503 0.9378 0.2385 0

>> plot(x,y)
>> %b%
>> a=3

a =

>> b=5

b =

>> r=7

r =

>> x=a+r*cos(t)

x =

Columns 1 through 10

10.0000 9.7615 9.0622 7.9497 6.5000 4.8117 3.0000 1.1883


-0.5000 -1.9497

Columns 11 through 20

-3.0622 -3.7615 -4.0000 -3.7615 -3.0622 -1.9497 -0.5000 1.1883


3.0000 4.8117

Columns 21 through 25
6.5000 7.9497 9.0622 9.7615 10.0000

>> y=b+r*sin(t)

y =

Columns 1 through 10

5.0000 6.8117 8.5000 9.9497 11.0622 11.7615 12.0000 11.7615


11.0622 9.9497

Columns 11 through 20

8.5000 6.8117 5.0000 3.1883 1.5000 0.0503 -1.0622 -1.7615


-2.0000 -1.7615

Columns 21 through 25

-1.0622 0.0503 1.5000 3.1883 5.0000

>> plot(x,y)
>> %c%
>> h=b*cos(2*t)-a*cos(t)

h =

Columns 1 through 10

2.0000 1.4323 -0.0981 -2.1213 -4.0000 -5.1066 -5.0000 -3.5537


-1.0000 2.1213

Columns 11 through 20

5.0981 7.2279 8.0000 7.2279 5.0981 2.1213 -1.0000 -3.5537


-5.0000 -5.1066

Columns 21 through 25

-4.0000 -2.1213 -0.0981 1.4323 2.0000

>> plot(h)

You might also like