Professional Documents
Culture Documents
clear;
clc;
x = 0:1:10;
y = x;
plot(x,y)
clear;
clc;
x =0:5:100;
y = x.^2;
plot(x,y)
clear;
clc;
x =-100:5:100;
y = x.^2;
plot(x,y)
MATLAB-PLOTTINTG
clear;
clc;
x = -100:20:100;
y = x.^2;
plot(x,y),xlabel('jumlah siswa'),ylabel('pendapatan gaji'),grid on ,tittle('Grafik y=x^2')
clear;
clc;
x = -100:20:100;
y = x.^2;
g = sin(x);
clear;
clc;
x = 0:0.01:10;
y = sin(x);
g = cos (x);
plot(x,y,x,g),legend('sin(x)','cos(x)'),xlabel('jumlah siswa'),ylabel('pendapatan
gaji'),grid on ,tittle('Grafik y=x^2')
clear;
clc;
x = -10:0.01:10;
f = 3*x.^4+2*x.^3+7*x.^2+2*x+9;
g = 5*x.^3+9*x+2;