%trqyectorias
clear
addpath /Francia/Velocidades

load N1u
load vn126
load N1v

u=N1u(190:end)/100;%
v=N1v(190:end)/100;%
vex=(vn126(275:end)+mean(N1u(275:end)))*std(N1v)/100;
uex=ones(size(vex))*mean(N1u(275:end))/100;

dt=24*60*60;
x=cumsum(u*dt)/1000;
y=(cumsum(v*dt)/1000)+50;
xex=cumsum(uex*dt)/1000;
yex=(cumsum(vex*dt)/1000)+50;

load vs126
load S1v
load S1u
%S1u=res(:,1);
%u2=((-us113(190:250)+mean(S1u(190:250)))*std(S1u))/100;
%v2=((vs113(190:250)+mean(S1v(190:250)))*std(S1v))/100;
u2=S1u(190:end)/100;%fs112(190:280)/100;
v2=S1v(190:end)/100;%fres111(190:280)/100;
v2ex=(vs126(275:end)+mean(S1v(275:end)))*std(S1v)/100;
u2ex=ones(size(v2ex))*mean(S1u(275:end))/100;

x2=cumsum(u2*dt)/1000;
y2=(cumsum(v2*dt)/1000)-50;
x2ex=cumsum(u2ex*dt)/1000;
y2ex=(cumsum(v2ex*dt)/1000)-50;

load adcpv13
load adcpu13
load /Francia/Velocidades/uvmoy
addpath /Francia/Estadisticas%aqui esta nanmean
addpath /Francia/Velocidades
vq=uvmoy(4,378:end)';vq=completo_series1(vq,5);
vq=vq(2:end-1);
uq=uvmoy(4,1:377)';uq=completo_series1(uq,5);
uq=uq(2:end-1);
%u3=((-adcpu13(190:250))*std(uq))/100;
%v3=((adcpv13(190:250))*std(vq))/100;
u3=uq(190:250);
v3=uq(190:250);
x3=cumsum(u3*dt)/1000;
y3=cumsum(v3*dt)/1000;


figure
for i=1:60
plot(x,y,'r')
hold on
pltvec(x(i),y(i),u(i),v(i),100,'k')
hold on

plot(xex,yex,'r')
hold on
pltvec(xex(i),yex(i),uex(i),vex(i),100,'k')
hold on

plot(x2,y2)
hold on

pltvec(x2(i),y2(i),u2(i),v2(i),100,'k')
hold on
plot(x2ex,y2ex)
hold on

pltvec(x2ex(i),y2ex(i),u2ex(i),v2ex(i),100,'k')
%plot(x3,y3,'g')
%hold on
%pltvec(x3(i),y3(i),u3(i),v3(i),100,'k')
k(:,i)=getframe;
end
