Info

This question is closed. Reopen it to edit or answer.

How to make a 1-D lookkup table with datapoints set at runtime?

1 view (last 30 days)
I'm trying to create a simple 1-D lookup table in simulink to interpolate between 2 points if the lookup is between the breakpoints, and extrapolate if the lookup is outside of them. (A future version will use 4 points.)
The table datapoints and the breakpoints are monotonically increasing and are set by parameters only known at runtime. To simulate I've made the data SimulinkGlobal Parameters.
The simulations work file but when I generate embedded code the code uses the values of the data, not the parameter names: there is no way to change the table datapoints and breakpoints at run time.
I have tried used the following:
  1. 1-D Lookup Table
  2. Lookup Table Dynamic
  3. Matlab function utilising the interp1 function [e.g. interp1(a,b,ui,'linear','extrap')]
Is there any way to make a lookup table that will use datapoints and breakpoints available at runtime?

Answers (0)

Community Treasure Hunt

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

Start Hunting!