%pro kazdy model hodnoty byly hodnoty upravaovany individualne
%% pro a. radialis
t = vstup(:,1);
u = vstup(:,2);
load('TIBIAL_physio.mat');
load('RADIAL_physio.mat');
x_dat =  RADIAL_PHYSIO{1,1}.ONE_CYCLE(:, 2);
t_dat =  RADIAL_PHYSIO{1,1}.ONE_CYCLE(:, 1);

tib_dat_x = ANT_TIBIAL_PHYSIO{1,1}.ONE_CYCLE(:, 2);
tib_dat_t =  ANT_TIBIAL_PHYSIO{1,1}.ONE_CYCLE(:, 1);

x_sim = ruka.data; %vystup ze Simulinkoveho modelu
t_sim = ruka.time; %vystup ze Simulinkoveho modelu

x_sim1 = x_sim;
t_sim1= t_sim;

x_sim1 = decimate(double(x_sim1),50);
t_sim1 = decimate(double(t_sim1),50);

x_sim1(300:end) = [];
x_sim1(1:180) = [];
t_sim1(300:end) = [];
t_sim1(1:180) = [];
plot(t_sim1, x_sim1)

subplot 121
title('a. radialis')
plot(t_dat,x_dat/95)
title('a. radialis')
xlabel('t [s]')
ylabel('P [mmHg]')
hold on
plot(t_sim1-1.95, x_sim1)
xlim([0 1])
xlabel('t [s]')
ylabel('P [mmHg]')
legend('Vzor','Simulace','Location','northeast')
set(findall(gca, 'Type', 'Line'),'LineWidth',2);
fig = gcf;
fig.Color = 'white';


%% pro a. tibialis
tib_x = noha.data;
tib_t = noha.time;

x_tib1 = decimate(double(tib_x),50);
t_tib1 = decimate(double(tib_t),50);


x_tib1(300:end) = [];
x_tib1(1:180) = [];
t_tib1(300:end) = [];
t_tib1(1:180) = [];
plot(t_tib1, x_tib1)

subplot 122
plot(tib_dat_t, tib_dat_x/95)
title('a. tibialis')
xlabel('t [s]')
ylabel('P [mmHg]')
hold on
plot(t_tib1-1.93, x_tib1)
xlabel('t [s]')
ylabel('P [mmHg]')
xlim([0 1])
legend('Vzor','Simulace','Location','northeast')
set(findall(gca, 'Type', 'Line'),'LineWidth',2);
fig = gcf;
fig.Color = 'white';

set(legend,'FontSize',40);
set(findall(gca, 'Type', 'Line'),'LineWidth',4);
% print('E prechodova','-dpng')

