%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                            Michael Pokojovy                             % 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

f = @(x) sin(1./x).*(x > 0);

figure(1);

set(gcf, 'PaperUnits', 'centimeters');
xSize = 16; ySize = 15;
xLeft = (21 - xSize)/2; yTop = (30 - ySize)/2;
set(gcf,'PaperPosition', [xLeft yTop xSize ySize]);
set(gcf,'Position',[0 0 xSize*50 ySize*50]);

hold on;

x = 0:0.0001:0.1;
plot(x, f(x));
x = 0.1:0.005:1;
plot(x, f(x));
plot([0 0], [-1, 1]);

xlabel('x');
ylabel('y');

t = title(['Plot der Menge ', '$X = \{(x, y) \,|\, 0 < x \leq 1, y = \sin(\frac{1}{x})\} \cup \{(0, y) \,|\, -1 \leq y \leq 1\}$'], 'interpreter', 'latex');
set(t, 'FontSize', 16);