フィルターのクリア

Interpolation

7 ビュー (過去 30 日間)
Ferd
Ferd 2012 年 4 月 23 日
Hello,
I have table values,
Table:
For, X-interval = 360-380 x-units, Y-interval = 2200-2400 y-units
Z-value = 900 z-units
Calculation: X-calc Value = 371x-units, Y-calc Value = 2375 y-units
Z-calc Value = ?
I looked up interp2, interp3 but since the first row and column are basically ranges or intervals and are basically just references for Z-table value, it doesn't give an answer. It says the z value must be a 2-by-2 matrix where in fact my z table value is just 1-by-1 value.
  1 件のコメント
Jan
Jan 2012 年 4 月 23 日
It is easier to answer, if you post a working set of inputs.
What are "y-units"?

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

採用された回答

Walter Roberson
Walter Roberson 2012 年 4 月 23 日
To clarify: if the combination holds of x in 360 to 380, and y in 2200 to 2400, then z should be the constant value 900? If so, use logical indexing.
Table = [360 380 2200 2400 900; 325 333 2817 2895 888]; %e.g.
z = NaN(size(X_calc));
for K = 1 : size(Table,1)
idx = X_calc >= Table(K,1) & X_calc <= Table(K,2) & ...
Y_calc >= Table(K,3) & Y_calc <= Table(K,4);
z(idx) = Table(K,5);
end
  1 件のコメント
Ferd
Ferd 2012 年 4 月 25 日
Hey! Kewl Thanks! It works...

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

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