필터 지우기
필터 지우기

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 CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by