Hi Denis,
I understand that you are interested in whether or not there is a way to use a lookup table block which can use variable-sized parameters.
From the documentation for the various lookup table blocks provided in Simulink, it appears that none of the them support variable-size signals. However, there appears to be a workaround for accomplishing this task. To accomplish this, you can make use of the "interp1" MATLAB function and the MATLAB function block in Simulink. I have provided a ZIP-file containing a model called "variable_size_lookup_table.slx" that contains a MATLAB function block that acts as a variable-size lookup table by using the "interp1" function. The following example code declares variables and generates some test data, and then simulates the model provided:
xdata = linspace(-2 * pi, 2 * pi);
ydata = sin(xdata);
xdata2 = linspace(-4 * pi, 4 * pi, 50);
ydata2 = cos(xdata2);
mdl = 'var_size_lookup_table';
sim(mdl);
figure(1); clf();
subplot(2, 1, 1);
plot(tout, yout);
I have also provided some additional example code for performing the code generation and verifying the output:
rtwbuild(mdl);
system([mdl, '.exe']);
data = load([mdl, '.mat']);
subplot(2, 1, 2);
plot(data.rt_tout, data.rt_yout);
One thing I should note is that you will not be able to output continuous samples by this method. You would need to do a rate transition from continuous to discrete samples, and then go back to continuous in the end. Another thing to note is that this example uses the "ert.tlc" system target file, which requires Embedded Coder. To test this without Embedded Coder, use the "grt.tlc" file instead. Please also note that I have only tested this in MATLAB R2014b and R2016a.
I hope this information proves to be helpful.
Matt