Anda di halaman 1dari 9

Penyelesaian Grafik Dengan

Matlab
http://spatabang.blogspot.com
Tugas : Hasilnya diprint, kumpulkan minggu depan

Buatlah grafik dari soal berikut:

1. y= sin 2x, -2  x  2 


2. y= sin (2x +  /2), -2  x  2 
3. y=x³ , -10  x  10
4. y={ -3, -2, 4, 3, 3, 1, 2, 5}
5. y = 3sin x + cos 3x, -   x  
6. Y = tag x – 2sin x + cos, -  i  x  
1. y= sin 2x, -2  x  2 
Kode Matlab :
>> x=-2*pi:0.1:2*pi;
>> y=sin(2*x);
>> plot(x,y)
2. y= sin (2x +  /2), -2  x  2 

Kode Matlab :
>> x =-2*pi:0.1:2*pi;
>> y =sin(2*x + pi/2);
>> plot(x,y)
3. y=x³ , -10  x  10
>> x= -10:1:10;
>> y=x.^3;
>> plot(x,y)
4. y = { -3, -2, 4, 3, 3, 1, 2, 5}

Kode Matlab:
>> y=[-3, -2, 4, 3, 3, 1, 2, 5];
>> plot(y)
5. y = 3sin x + cos 3x, -   x  

Kode Matlab :
>> x=-pi:0.1:pi;
>> y= 3*sin(x) + cos(3*x);
>> plot(x,y)
6. y = tag x – 2sin x + cos, -  i  x  

Kode Matlab:
>> x=-pi:0.1:pi;
>> y=tan(x) - 2*sin(x) + cos(x);
>> plot(x,y)
Sekian

Anda mungkin juga menyukai