Interpolation

2 次查看(过去 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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by