How to create a 2D lookUp table in matlab
Show older comments
I want to create a 2D look Up table from 3 arrays
x1= 0:0.1:1 %axis values --> length is 11
x2= 25:2:35 %axis values --> length is 6
y= 0.01:0.001:0.06 % output data --> length is 51, rest of the 15 elements are zeros
I want to create an LUT which has 6 rows and 11 columns. Whenever I need to retrieve y, if exact query points of x1 and x2 is not present, then the function should give an interpolated value. I want to generate a .m script for this without using Simulink.
Anyone please help me with this.
Thanks
2 Comments
Walter Roberson
on 2 Aug 2016
length(y) is 51. If you were given the J'th x1 value exactly and the K'th x2 value exactly (so no interpolation needed), which of the 51 y values should be output?
Accepted Answer
More Answers (1)
Satishkumar Aruljothi
on 2 Aug 2016
Edited: Satishkumar Aruljothi
on 2 Aug 2016
1 vote

Use 2-D looup table from simulink library.
see the attached image.
1 Comment
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!