Hi! I'm porting a Matlab code into Julia, so far my results are amazing: The program in Matlab takes 5-6 hours to run while the program in Julia takes a little more than 8 minutes! However, there is a difference in the results...
In julia i'm using the Interpolations package to do the same thing i did with interp1 in matlab: for xx=1:xlong > for yy = 1:ylong > U_alturas(xx,yy,:) = interp1(squeeze(NivelAltura_int(xx,yy > ,:)),squeeze(U(xx,yy,:)), interpolar_a); > V_alturas(xx,yy,:) = interp1(squeeze(NivelAltura_int(xx,yy > ,:)),squeeze(V(xx,yy,:)), interpolar_a); > end > end. > And in julia: > Uinterp = > interpolate((squeeze(NivelAltura_int[xx,yy,1:end],(1,2)),),squeeze(U[xx,yy,1:end],(1,2)),Gridded(Linear())); > Vinterp = > interpolate((squeeze(NivelAltura_int[xx,yy,1:end],(1,2)),),squeeze(V[xx,yy,1:end],(1,2)),Gridded(Linear())); > Uextrap = extrapolate(Uinterp,NaN); > Vextrap = extrapolate(Vinterp,NaN); > U_alturas[xx,yy,1:end] = Uinterp[Alturas[1:end]]; > V_alturas[xx,yy,1:end] = Vinterp[Alturas[1:end]]; > Where the tu lines in the middle are intended to produce NaN if the point is out of the domain. The matter is that Matlab, for some values of xx,yy, produces NaN, while Julia produces numbers, which is not correct. What could i be missing? If the two middle lines are the correct way to establish the behavior for points outside the domain, maybe the difference comes from another reason. Can you help me? Thanks!
