MATLAB: Can I have a Simulink Lookup table block that looks up different datasets for the same input and returns multiple outputs

lookupsimulinktable

The current one-dimensional lookup table block looks up for a data value within a single dataset. I would like to look up for values across multiple data sets with a single input to a single Lookup Table block. In other words, I have a data set with same Xinputs but Multiple one-dimensional YOutputs. Given a data point, I would like to interpolate across all the YOutpus in one go.

Best Answer

To look up values across multiple data sets with a single input in a single Lookup Table block can be achieved using 'Prelookup' and 'Interpolation for Prelookup' blocks in the lookup table library of SIMULINK.
The 'Prelookup' block contains the dataset of independent variable. It takes in the value of the independent variable (that needs to be interpolated), and outputs the index and interval fraction specifying how this value relates to the data set of the independent variable.
The 'Interpolation for prelookup' block, contains different data sets of the dependent variable. The block takes in the output of 'Prelookup' block, and gives out the interpolated values of the dependent variable.
Attached is a SIMULINK model that illustrates this for one data set of independent variable and two data sets of dependent variable.
In addition:
You may copy the text file and save that file as MDL file . it will convert text file into MATLAB model then you can open it as a Simulink model.