From: Thomas W. <we...@nu...> - 2005-03-03 08:21:25
|
Paul, > I rewrote much of the argument processing and made use of > lookup() to simplify the code. Thanks - I feel somewhat stupid for my long code. > Please let me know if you have any problems with it. Actually yes, I have problems with it. They are not due to your (or my) changes, but I consider this function flawed. I'm currently in the following situation: x, y: vectors of length ~200 Z: matrix of 200^2 xi, yi: vectors of length ~16000 Now, interp2 tries a meshgrid(xi,yi), which results in 'out of memory'. However, I'm only interested in the interpolated values at [xi(i), yi(i)], not at the complete grid one can construct with these vectors. Therefore, I'm thinking about changing the function to return an interpolated vector at the positions of (xi,yi) if they are vectors; if the user wants a complete grid, he can still do an [XI, YI] = meshgrid(xi,yi) before and hand the matrices to interp2. Please note that this will break compatibility with Matlab (which shows the same 'out of memory' behaviour). Any suggestions? Regards Thomas |