フィルターのクリア

I have a table of three columns and I want to find a particular value in third column using interpolation, how can I do that if I know the values at first two columns?

2 ビュー (過去 30 日間)
The three columns are there and I have a particular set of values (x,y) and I want to find a particular value at third column corresponding to (x,y) by interpolation. I tried interp2 but it shows "Interpolation requires at least two sample points for each grid dimension.".
Any sort of insight would be great on this one
  2 件のコメント
dpb
dpb 2022 年 6 月 8 日
"Any sort of insight would be great..."
Yeah, like give us a sample dataset to work with and show us what you're wanting for output...
ekagra gupta
ekagra gupta 2022 年 6 月 8 日
編集済み: dpb 2022 年 6 月 8 日
Ohh yeah sure I apologise.
X= [1 2 3 4]
Y= [3 6 10 12]
Z= [2 4 6 8]
So I have (X, Y) = (3.5, 4.5) And I want value of Z

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

採用された回答

dpb
dpb 2022 年 6 月 8 日
>> SI=scatteredInterpolant(X.',Y.',Z.')
SI =
scatteredInterpolant with properties:
Points: [4×2 double]
Values: [4×1 double]
Method: 'linear'
ExtrapolationMethod: 'linear'
>> SI(3.5,4.5)
ans =
7.0000
>>
To use interp2 you would have to have all 16 Z values; SI will do its best with what it has to work with...

その他の回答 (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