Matlab中2D插值的功能形式

Matlab中2D插值的功能形式

本文介绍了Matlab中2D插值的功能形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从2D数据数组构造一个插值函数.我需要返回实际函数的东西的原因是,我需要能够将函数作为需要进行数值积分的表达式的一部分进行求值.

I need to construct an interpolating function from a 2D array of data. The reason I need something that returns an actual function is, that I need to be able to evaluate the function as part of an expression that I need to numerically integrate.

因此,"interp2"不会剪切它:它不会返回函数.

For that reason, "interp2" doesn't cut it: it does not return a function.

我可以使用"TriScatteredInterp",但这很重:我的网格等距(并且很大);所以我不需要delaunay三角化.

I could use "TriScatteredInterp", but that's heavy-weight: my grid is equally spaced (and big); so I don't need the delaunay triangularisation.

还有其他选择吗?

推荐答案

(为迟到"的答案表示歉意,但我有一些建议,如果现有答案对其他人没有帮助的话,可能会有所帮助)

(Apologies for the 'late' answer, but I have some suggestions that might help others if the existing answer doesn't help them)

从您的问题尚不清楚,结果函数需要多精确(或多大,大"),但是您可以采用的一种方法是使用最小二乘或基于卡尔曼滤波器的方法.您需要使用多种候选函数形式来执行此操作,然后选择最佳"函数形式,例如通过使用诸如MAE或MSE之类的度量.

It's not clear from your question how accurate the resulting function needs to be (or how big, 'big' is), but one approach that you could adopt is to regress the data points that you have using a least-squares or Kalman filter-based method. You'd need to do this with a number of candidate function forms and then choose the one that is 'best', for example by using an measure such as MAE or MSE.

当然,这需要对底层函数的形式有一些了解,但是对于您是否拥有这种信息,您的问题尚不清楚.

Of course this requires some idea of what the form underlying function could be, but your question isn't clear as to whether you have this kind of information.

另一种可行的方法(不需要了解底层函数可能是什么)是使用模糊变换(F-transform)来生成为曲面提供局部近似的线段.

Another approach that could work (and requires no knowledge of what the underlying function might be) is the use of the fuzzy transform (F-transform) to generate line segments that provide local approximations to the surface.

此方法为:

  1. 定义一个包含输入数据的x和y域的2D Universe
  2. 创建该Universe的2D模糊分区-选择分区大小以提供所需的精度
  3. 使用输入数据应用离散F变换以在3D模糊空间中生成模糊数据点
  4. 将逆F变换作为函数句柄(连同模糊数据点一起)传递给您的积分函数

如果您不熟悉F变换,那么我前不久发布了一个博客,内容涉及如何在1D情况下将F变换用作通用逼近器: http://iainism-blogism.blogspot.co.uk/2012/01/fuzzy-wuzzy-was.html

If you're not familiar with the F-transform then I posted a blog a while ago about how the F-transform can be used as a universal approximator in a 1D case: http://iainism-blogism.blogspot.co.uk/2012/01/fuzzy-wuzzy-was.html

要查看该方法背后的数学并将其扩展到多维案例,那么俄斯特拉维亚大学发表了博士学位论文,解释了其在各种工程问题中的应用,并提供了如何针对这种情况构造示例.2D世界: http://irafm.osu.cz/f/PhD_theses/Stepnicka.pdf

To see the mathematics behind the method and extend it to a multidimensional case then the University of Ostravia has published a PhD thesis that explains its application to various engineering problems and also provides an example of how it is constructed for the case of a 2D universe: http://irafm.osu.cz/f/PhD_theses/Stepnicka.pdf

这篇关于Matlab中2D插值的功能形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 11:03