Extrapolation 2-D lookup table

조회 수: 13 (최근 30일)
jose tapia
jose tapia 2011년 3월 26일
댓글: hang x 2020년 7월 28일
Hi, I'm having the following problem. I have a 2d table that contains data from some measurements. How can I do the same kind of Extrapolation that is possible in SIMULINK 2-D table lookup using interpolation-extrapolation lookup method, but in Matlab. As I figured out 'griddata' and 'interp2' can not do the job for me. This is the dimension of my data:
x [1x37]
y [1x28]
z [28x37]
Thanks in advance.
  댓글 수: 4
Jette
Jette 2011년 11월 22일
I do want to do it in MATLAB and get rid of Simulink models which basically only use lookup tables. I meant the algorithm or the underlying function Simulink uses.
Titus Edelhofer
Titus Edelhofer 2011년 11월 22일
Hi Jette, nice to meet you again ;-). Titus

댓글을 달려면 로그인하십시오.

답변 (3개)

Matt Fig
Matt Fig 2011년 3월 26일
I don't know what kind of extrapolation is done in Simulink, but have you looked on the FEX? This might help, for example:
  댓글 수: 1
jose tapia
jose tapia 2011년 3월 31일
Hi, Matt. Thanks for your answer.
INTERPNE doesn't work for me, because the data I have doesn't fit with the function.

댓글을 달려면 로그인하십시오.


Titus Edelhofer
Titus Edelhofer 2011년 11월 22일
Hi Jose,
in a German forum I gave a description on how the interpolation of Simulink works, see here, although I don't have a working solution. If you care for how the extrapolation works, I would translate here.
Titus
  댓글 수: 2
jose tapia
jose tapia 2011년 11월 22일
Thank's for your help. This is very useful.
Ilham Hardy
Ilham Hardy 2015년 4월 16일
Hi Titus,
I know it is four years ago, but would you please describe how the 2D-LUT in Simulink works? This time in English?
I check the link you gave and translate it, but still I don't get it yet. The solution post by Jette is not complete (I mean ZI_1 is still matrix).
Thanks a lot, Ilham

댓글을 달려면 로그인하십시오.


Mehmet Özdemir
Mehmet Özdemir 2018년 6월 13일
Hi everyone,
I was struggling with the same problem for some time and finally found a very easy solution. Save the date.
INPUT PARAMETERS
x = Column indicator of the matrix
y = Raw indicator of the matrix
v = Look up table matrix
xq, yq = Point where interpolation takes place
THE CODE
vq1 = interp1(x,v',xq,'linear','extrap') % This calculation gives an array which are the interpolated values (wrt xq) of every raw. PS : Don't forget to take the transpose of v matrix.
vq = interp1(y,vq1,yq,'linear','extrap') % This part interpolates the new calculated vq1 for the value yq and gives the final result
Since it is possible to extrapolate by adding ///,'linear','extrap'/// in this method, your task of extrapolating 2d maps will be accomplished. Good by NaNs.
Best
  댓글 수: 1
hang x
hang x 2020년 7월 28일
It's a nice way to solve this problem,thanks for sharing it

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Lookup Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by