clear; clc; close all;

x = linspace(0, 2 * pi, 30);
y = sin(x);
z = cos(x);

figure;
plot(x, y, 'r--'); hold on;
plot(x, z, 'bo:');
grid on;
xlabel('Time (s)');
ylabel('Amplitude (V)');
title('Input/Output');
h = legend({'Input', 'Output'});
set(h, 'Position', [0.5, 0.8, 0.17, 0.1]);
print(gcf, '-djpeg', 'multipleCurves.jpg', '-r300');

figure;
plot(x, y + z); grid on;