I started working with Simulink and struggeling with the following problem:
I have a time vector
timeVec = [0 1 2 3 3.5 4.2 5.5 7 8];
and a data vector
dataVec = rand(length(timeVec),1)*5+2;
What I need is a Simulink model which interpolates the 'dataVec' Vector based on the simulation time steps, speaking from 0 to 8 in 0.1 intervals.
I did reproduce the example of the documentation (see https://de.mathworks.com/help/dsp/ref/interpolation.html) but it was not yet possible for me to solve my problem. Am I a least using the correct block? The Vector 'dataVec' in Simulink is given by a constant source block.
Thank you for your help!
Just use the 1D Lookup Table, where your dataVec
and timeVec
are the appropriate block parameters. You can use any of several blocks as an input signal, including Clock or Ramp, depending on other requirements such as do you need to generate code from the model, and/or what solvers settings you are using.