The theory of "_mergesimpts" of builtin functions.

조회 수: 10 (최근 30일)
Suyee Bai
Suyee Bai 2016년 3월 30일
답변: Peng Liu 2016년 8월 22일
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에서 Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by