% Compute y(x) = x^2 - 3x + 2 using a for loop. This for loop
% version calculates one value of y for one value of x per
% iteration.

x= .1:.1:3;
y= zeros(1,length(x));  %creating the entire y vector first is 
                        %not necessary
for index= 1:length(x)				
     y(index)= x(index)^2 - 3*x(index) + 2; 
end

