% This script plots sin(x) and cos(x) in the same Figure Window % for values of x ranging from 0 to 2*pi clf x1 = 0: 2*pi/40: 2*pi; x2 = 1: 2*pi/40: 2*pi+1; y1 = sin(x); y2 = cos(x); x = [x1', x2']; y=[y1' y2']; plot(x,y) axis padded legend('sin', 'cos') xlabel('x') ylabel('sin(x) or cos(x)') title('sin and cos on one graph')