In some cases, the data forms an implicit grid.
For example if your longitude repeated every 5 values and your latitude had 5 copies of every value in a row, then that would be data for a implicit grid that was 5 by something.
In such cases, when you identify the repeat period, you can reshape() the lat, lon, and A values according to the repeat period, in order to get a 2D array. In some cases you might need to reshape() with the period in the other position than you expect and transpose the result. For example,
However, in other cases, there is no implicit grid. There might be an approximation of a grid, such as you might get if you did not bother to put in any entries for locations that were on land, but using reshape() only works if there is a full implicit grid. In such cases, use scatteredInterpolant() and invoke it on a grid of locations to sample at:
F = scatteredInterpolant(lon, lat, A);
N = 100;
lonv = linspace(min(lon), max(lon), N);
latv = linspace(min(lat), max(lat), N);
[lonG, latG] = ndgrid(lonv, latv);
Ainterp = F(lonG, latG);
surf(lonG, latG, Ainterp)