% Plot the polynomial "y = 3*x + pi/2"  for x in the interval [-3, 5]

x = linspace(-3, 5);  
y = 3*x + pi/2;

figure(1);
plot(x, y);
xlabel('x');
ylabel('y');
title('Plot of polynomials');
gtext('y = 3*x + pi/2');     % place text with mouse


% Add another polynomial "y = x^2 - x -2" to the same figure
hold on;      % cause the second plot not to erase the first
y = x.^2 - x -2;
plot(x, y, 'r --');     % plot using red colour and dashed line
gtext('y = x^2 - x -2');

% Add a point (3,4) to the figure
plot(3, 4, 'g *');
text(3.1, 4, '(3, 4)');
hold off;      % allow the next plot to erase previous plots
