Hey all,
I have a velocity values over 720 time steps for a curvilinear grid (40x144x720). I would like to obtain the peak in all the grid points. One problem that I have is that the number of peaks are different in all the points.
I tried using the function findpeaks, and if I discretize one point, it works well. My problems is when I try the loops and I don´t know really well I storage the output.
u_atl=squeeze(u(:,:,1,:));%size(40x144x720)
n=720; %time steps
i=zeros(40,144);%latitud and longitud
j=zeros(40,144);for i=1:40 for j=1:144 for k=1:n [pval(i,j,k),ploc(i,j,k)]=findpeaks(u_atl(i,j,k),'minpeakdistance',6); [peak_ebb(i,j,k),ploc(i,j,k)]=findpeaks(-u_atl(i,j,k),'minpeakdistance',6); end endend
I'm pretty new in Matlab so I hope you can help me.
Thanks in advice,
Miguel.
Best Answer