%  Plot the velocity profiles as a function of time
%
%  Version 1.0, 9/9-97, JAJ
%  Version 1.2, 18/9-2017, JAJ
%      Modified for support in Matlab 2017

%  Find the scaling for the velocity

y=-1:deltaR:1;
vmin=min(min(profiles));
vmax=max(max(profiles));

%  Plot the profiles
   
time_index=1;
axes(hp1)
[~,M]=size(y);
N=floor(M/2);
pro =[profiles(N+1:-1:2,1); profiles(1:N+1,1)];
plot(y,pro,'w','LineWidth',2);
set(gca,'FontSize',16)
ph = line(y*R*1000,pro,'color','b','LineWidth',2);

axis([-R*1000 R*1000 vmin*1.1 vmax*1.1])
xlabel('Radius [mm]')
ylabel('Velocity [m/s]')
title(artery_name)

%  Plot the profiles 10 times

for i=1:10
    time_index=1;
    for time=0:deltaT:2*pi/omega_0
        pro =[profiles(N+1:-1:2,time_index); profiles(1:N+1,time_index)];
        place= time/(omega_0/(2*pi))*360;
        set (ph, 'Xdata', y*R*1000, 'Ydata', pro);
        drawnow update
        tic;
        while (toc < deltaT)
            j=sin(pi);
        end
        time_index=time_index+1;
    end
end


