%PENG4.4
clear all; 
clc;

step = 0.1;
%case one
Y1 = [];
X1 = [];
for i=-1:step:3
    y=i^2-3*i+2;  
    Y1 = [Y1;y]; 
    X1 = [X1; i];
end
%plot(X1,Y1','b'); hold on;

%case 2
x=-1:step:3;
Y2=x.^2-3*x+2;
%plot(x,Y2, 'r*','LineWidth',3.0); hold off;

subplot(211);
plot(X1,Y1','b');
xlabel('x');
ylabel('y(x)')
subplot(212);
plot(x,Y2, 'r*','LineWidth',3.0);

