clear; clc; close all;

x = linspace(0, 2 * pi, 20);
y = sin(x);
z = cos(x);
w = y + z;

h = figure;
p1 = plot(x, y, 'ro--'); hold on;
p2 = plot(x, z, 'bd:');
set(p1, 'DisplayName','Input','Marker','o','LineStyle','--',...
    'Color',[1, 0.411, 0.16]);
set(p2, 'DisplayName','Output','Marker','diamond','LineStyle',':',...
    'Color',[0.30, 0.75, 0.93]);
xlabel('Time (s)');
ylabel('Amplitude (volt)');
legend({'Input', 'Output'});
annotation(h, 'arrow', [0.6 0.65], [0.5 0.6]);
grid on;
print(gcf, '-djpeg', 'test.jpg', '-r300');

figure(3);
plot(x, w);
