フィルターのクリア

scatteredInterpolant gives null matrix for collinear data . .

12 ビュー (過去 30 日間)
Parthu P
Parthu P 2020 年 1 月 10 日
回答済み: Farough Rahimzadeh 2022 年 3 月 29 日
Hello, I want to interpolate scattered data (x,y,z). x and y are collinear (x and y = [0.05 0.1 0.15 0.20 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6] ).
When I use:
F = scatteredInterpolant(x, y, z);
[Xq, Yq] = meshgrid(x, y);
Zq = F(Xq, Yq);
I get empty Zq with following error : The underlying triangulation is empty - the points may be collinear.
Please help me on this.
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 1 月 10 日
Add a small random offset to x and y so that they are not colinear
Parthu P
Parthu P 2020 年 1 月 11 日
Thanks a lot!
It worked very well.

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2020 年 1 月 11 日
Use interp1() instead.

Farough Rahimzadeh
Farough Rahimzadeh 2022 年 3 月 29 日
One trick you can do is to add one number to the end the array to remove the collinear correlation.
For example, my data is gravitational force at certain coordinates. Because I know gravitational force at 1e8 distance is roughphy equal to zero, I added one addition point of (1e8, -1e8, 0) to the data set to remove the linear correltion.
x = [1 2 3 4 5, 1e8];
y = [1 2 3 4 5, -1e8];
z = [1.8 1.2 2.2 1.9 1.2, 0];

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by