clear;clc;close all;

set(0,'defaulttextinterpreter','Latex');

[x,t] = importData( 'A1A.txt' );
xtest1 = x(1,:);
xtest2 = x(4,:);
xtest3 = x(8,:);

figure(1) %Obr 4.2,4.3,4.4,4.5
plot(t,xtest1,t,xtest2,'r',t,xtest3,'m');
xlabel('$\tau [s]$');
ylabel('$T_e[^{\circ}C]$');
ylh = get(gca,'ylabel');
gyl = get(ylh);                                                        
ylp = get(ylh, 'Position');
set(ylh, 'Rotation',0, 'Position',ylp, 'VerticalAlignment','middle', 'HorizontalAlignment','right')
set(gca,'FontSize',25)
xlim([0 t(end)])

df = diff(xtest1);
adf = abs(df);
ndf = adf/max(adf);

figure(2) %Obr 4.6
plot(t(1:end-1),ndf);
xlabel('$\tau [s]$');
ylabel('$NDT_e[^{\circ}C]$');
xlim([0,t(end)])
ylh = get(gca,'ylabel');
gyl = get(ylh);                                                        
ylp = get(ylh, 'Position');
set(ylh, 'Rotation',0, 'Position',ylp, 'VerticalAlignment','middle', 'HorizontalAlignment','right')
set(gca,'FontSize',25)

y = gauss(10,xtest3);
dy = diff(y);
ady = abs(dy);
ndy = ady/max(ady);

figure(3) %Obr 4.7
plot(t(1:end-1),ndy);
xlabel('$\tau [s]$');
ylabel('$NDT_e[^{\circ}C]$');
xlim([0,t(end)])
ylh = get(gca,'ylabel');
gyl = get(ylh);                                                        
ylp = get(ylh, 'Position');
set(ylh, 'Rotation',0, 'Position',ylp, 'VerticalAlignment','middle', 'HorizontalAlignment','right')
set(gca,'FontSize',25)

