%% ----------------------------------------------------------------
dx = .1;
x = [0: dx: 10];
y = sin(x);
plot(x, y, '-o', 'LineWidth', 2)

yp = gradient(y, dx);
hold on;
plot(x, yp, '-o', 'LineWidth', 1)

set(gcf, 'PaperPositionMode', 'Manual');
set(gcf, 'PaperPosition', [0 0 7.0 2.0])
print -depsc yyp


