Professional Documents
Culture Documents
1. x = 0:pi/100:2*pi;
y= sin(x);
plot(x,y)
2. Save as TWODPIsine
3. xlabel ('x')
ylabel ('y')
title ('Plot of the sine function')
4. plot(x,y,'r--')
hold on
y2 = cos(x);
plot (x, y2, ':')
legend ('sin' , 'cos')
;jgn tulis sine n cos, tulis lain
9. Guna coding yg sama tetapi warna yg sama selain merah dan biru.
10. x = 0: 0.05:5;
y = sin (x.^2);
figure
plot (x,y)
12. Tukar kecilkan scale and tambah range, add labeling : 0.07
13. t = 0:pi/10:2*pi;
[X,Y,Z] = cylinder(4*cos(t));
subplot(2,2,1); mesh(X); title ('X');
subplot(2,2,2); mesh(X); title ('Y');
subplot(2,2,3); mesh(Z); title ('Z');
subplot(2,2,4); mesh(X,Y,Z); title ('X,Y,Z');