From: Paul K. <pki...@us...> - 2005-06-13 02:50:39
|
On Jun 12, 2005, at 10:00 PM, Tom Holroyd wrote: >> The bug is in the documentation for not saying that the function is >> restricted to meshgrids :-) > > Ah, yeah, I was afraid of that. :-) > > It actually interpolates each point correctly, so one workaround is to > just call it repeatedly for each point. That's a little bit slow, but > if it only has to be done once it's almost tolerable. I might get > around to it fixing it eventually but it's a bit low on my list at the > moment. On second thought, it is not so bad. Rather than using (i,j) indexing, which grabs regular submatrices, use (i+(j-1)*m), which grabs individual elements. See attached. Note that unlike interp2, calling interp2fi with vectors xi,yi will not automatically form a meshgrid. Note also that x,y are still constrained to meshgrids. Working around that will require griddata. - Paul |