The theory of "_mergesimpts" of builtin functions.

1 次查看(过去 30 天)
I'm trying to learn the theory of the function "griddata",and in the file "griddata.m",I found some codes like: xyv = builtin('_mergesimpts', [y, x, v], [myepsy, myepsx, Inf], 'average'); I cant find the source code or theory of "_mergesimpts",can u explain the theory of it please? Thanks a lot.:)

回答(2 个)

Walter Roberson
Walter Roberson 2016-3-30
By context I can tell that it looks for points whose x is closer than myepsx and whose y is closer than myepsy, and that if it finds them then it replaces the pair with a single point whose value is the average of the values at the other two points.
I do not know how it handles "lines" of points, A close to B close to C but A not close to C.
  1 个评论
Suyee Bai
Suyee Bai 2016-3-30
编辑:Suyee Bai 2016-3-30
The results of some tests of the function are as follows:
x = 1:0.001:10;
x = x.';
x0 = builtin('_mergesimpts',x,0.001,'first');
x1 = builtin('_mergesimpts',x,0.005,'first');
x2 = builtin('_mergesimpts',x,0.2,'first');
x3 = builtin('_mergesimpts',x,0.5,'first');
x4 = builtin('_mergesimpts',x,1,'first');
x5 = builtin('_mergesimpts',x,2,'first');
the data of x0,x1,x3,x4,x5 showed its regularity but the data of x2 doesnt. it's really hard to understand this phenomenon.

请先登录,再进行评论。


Peng Liu
Peng Liu 2016-8-22
It is an undocumented built-in function, which finds unique elements/rows within a specified tolerance. You may find a detailed introduction about this functon: http://stackoverflow.com/questions/1988535/return-unique-element-with-a-tolerance
Matlab 2015a introduced a documented built-in function, uniquetol, to achieve a similar task.

类别

Help CenterFile Exchange 中查找有关 NaNs 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by