clear, clc

%% SL9:
close all

myPlotObj = plot(0:10);
% get function
myLineWidth = get(myPlotObj,'linewidth');
% set function
set(myPlotObj, ...
    'Color','g', ...
    'LineStyle',':', ...
    'linewidth',myLineWidth + 1.5);
 
%% SL10
clear, close all

myPlotObj = plot(sin(0:0.2:2*pi));
myPlotObj.Color	= 'r';
myPlotObj.LineStyle	= 'none';
myPlotObj.Marker	= '^';

%% SL15 with plotyy
clear, close all

x  = 0:0.1:10;
y1 = 200 * exp(-0.05*x) .* sin(x);
y2 = 0.8 * exp(x);

subplot(1, 2, 1)
[axObjs, lin1Obj, lin2Obj] = plotyy(x, y1, x, y2, 'plot', 'semilogy');

lin1Obj.Color	   = 'k';
lin2Obj.Color	   = 'b';

axObjs(1).YColor  = 'k';
axObjs(2).YColor  = 'b';

subplot(1, 2, 2)
plot(x, y1, x, y2);

%% SL15 with yyaxis
clear, close all

x  = 0:0.1:10;
y1 = 200 * exp(-0.05*x) .* sin(x);
y2 = 0.8 * exp(x);

hAx = subplot(1, 2, 1);
yyaxis left
plot(x, y1, 'k')
hAx.YAxis(1).Color = 'k';
 
yyaxis right
semilogy(x, y2, 'b')
hAx.YAxis(2).Color = 'b';
 
subplot(1, 2, 2)
plot(x, y1, x, y2);

%% SL20
clear, close all

x  = 0:2:50;
y1 = exp(0.05*x) .* sin(x);
y2 = exp(0.01*x) .* cos(x);

f = figure('Color', 'w');
subplot(2, 2, 1);
stem(x, y1, 'MarkerFaceColor', 'blue'); hold on;
stem(x, y2, 'MarkerFaceColor', 'red', 'Marker', 'square'); grid on;
legend('e^x^/^2^0sin(x)', 'e^x^/^1^0^0cos(x)', 'Location','Northwest');
xlabel('x'); ylabel('y1, y2'); title('display using STEM');
 
subplot(2, 2, 2);
plot(x, y1, 'bo-', x, y2, 'g*--');
legend('f_1 (x)', 'f_2 (x)', 'Location', 'Southwest');
xlabel('0:2:50'); ylabel('y_1 = f_1(x), y_2 = f_2(x)');
title('display using PLOT');
 
subplot(2, 2, [3, 4]);
stairs(x, y1, 'LineWidth', 2); hold on; grid on;
stairs(x, y2, 'Color', 'r', 'Marker', 'x', 'LineWidth', 2);
title('display using STAIRS');

%% SL27
clear, close all

CH = repmat(eye(2),4,4);
imagesc(CH);
colormap gray;

%% SL 38, 45, 53 and 60 in separated file creategui.m

