From: Paul K. <pki...@us...> - 2005-03-03 13:04:21
|
On Mar 3, 2005, at 3:21 AM, Thomas Weber wrote: > Paul, >> 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? > Please don't break compatibility. You can make a new function which doesn't do an implicit meshgrid on the xi,yi arguments and call it from interp2. I don't really like that solution, but I can't think of a nice way to mark which form of xi,yi you want in the parameter list. - Paul |