How to use interpn on non-monotonic data

半腔热情 提交于 2019-12-06 04:16:58

I am afraid that your problem goes a bit beyond the monotony of the vectors. To use interpn in this case you would also need R to be a 3 dimensional matrix. Also the values for 0.06 and 0.07 seem to be outside the range of X and Y respectively.

If you can fix the range problem, try using the function

yi = griddatan(x,y,xi)

In your case the thing would look like:

Grid=[X,Y,Z];
Point=[0.03,0.05,0.08] % with values inside the grid and maybe transposed like  Point=[0.03;0.05;0.08]; I don't know, didn't try it myself.

Result=griddatan(Grid,R,Point);

Hope that works, as I wrote above, I didn't try running it, so you might have to transpose the things here and there to get it working, but I'm almost sure that griddatan() should do the trick.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!