Extrapolation 2-D lookup table
显示 更早的评论
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
2011-11-21
I came across the same question as jose tapia. I also could not find anything in the FEX. Doesn't anyone have an idea how this is done in Simulink?
Kaustubha Govind
2011-11-21
Jette: Jose's question was about being able to do something in MATLAB that is already possible in Simulink using the Lookup Table blocks. It appears that you want to do something in Simulink itself. Please start a new question if one of the Lookup Table blocks is not sufficient for your purpose.
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
2011-11-22
Hi Jette, nice to meet you again ;-). Titus
回答(3 个)
Matt Fig
2011-3-26
0 个投票
I don't know what kind of extrapolation is done in Simulink, but have you looked on the FEX? This might help, for example:
Titus Edelhofer
2011-11-22
0 个投票
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
2011-11-22
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
2018-6-13
0 个投票
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
2020-7-28
It's a nice way to solve this problem,thanks for sharing it
类别
在 帮助中心 和 File Exchange 中查找有关 Lookup Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!