StaMPS ps_gescatter - problems definining lon & lat

I am trying to plot only the velocity points that are within a boundary (my AOI) using the ps_gescatter function. According to the file, it takes the following inputs:

function ps_gescatter(filename,data,step,opacity,climsmtx,lon_rg,lat_rg,stdev_cutoff)

So I call with the following parameters:

ps_gescatter('ps.kml',ph_disp,1,1,[],[-8.603761, -8.592224],[40.057540, 40.066313])

And I get this error:

Index in position 1 exceeds array bounds (must not exceed 356).

Error in ps_gescatter (line 83)
      gescatter(filename,lonlat(step,1),lonlat(step,2),data(step,:),'scale',0.2,'colormap','jet','opacity',opacity)

Does anyone know why? Are my input arguments correct? It works if I don’t input lon_rg and lat_rg params.

have you managed to solve this error yet ?