フィルターのクリア

What makes the difference between griddata and griddatan?

4 ビュー (過去 30 日間)
Peng Liu
Peng Liu 2017 年 2 月 2 日
コメント済み: Honglei Chen 2017 年 2 月 3 日
Since griddatan is the n-d generalization of griddata, I assume that for 2-d scenarios, they should have identical behavior. This is true for most cases. For example:
uv = [-6,-13;-3,-9;-9,-2;-12,7;25,-14;16,-24;3,15];
xy = [8,6;15,1;4,-11;-3,9];
z1 = griddata(uv(:,1),uv(:,2),uv(:,2),xy(:,1),xy(:,2))
z2 = griddatan(uv,uv(:,2),xy)
The output is:
z1 =
6.0000
NaN
-11.0000
9.0000
z2 =
6.0000
NaN
-11.0000
9.0000
But in the following example, griddata gives valid output while griddatan fails.
uv = [0,0;0,2;2,2;2,0];
xy = [1,1;3,1];
z1 = griddata(uv(:,1),uv(:,2),uv(:,2),xy(:,1),xy(:,2))
z2 = griddatan(uv,uv(:,2),xy)
The error message indicates that some internal check of the convex hull in griddatan fails. But why is that? Why griddata run without a similar convex check? Thanks.
  1 件のコメント
Honglei Chen
Honglei Chen 2017 年 2 月 3 日
I'd suggest you report this to MathWorks. Regardless of the reason, you certainly should get a better error message.

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

回答 (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