Tipe Plot

Posted by the evolution | Posted in

Gambar grafik yang di dapat dari 2 dimensi dengan perintah-perintah plot..
Listing M-file:



% Definisi fungsi:
x = 0:0.5:20;
y = 2*x.^2 + 5*x + 2;
z = sqrt(4*x + 2);

subplot(2,1,1)
plot(x,y,'r')       % gambar plot untuk x & y
grid on;            % hidupkan mode grid
xlabel('Nilai x'), ylabel('Nilai y')
legend('x thd y')

subplot(2,1,2)
plot(x,z,'b')       % gambar plot untuk x & z
grid on;            % hidupkan mode grid
xlabel('Nilai x'), ylabel('Nilai z')
legend('x thd z')





Comments (0)

Posting Komentar