使用 Simulink 插值不一致数据

Interpolation of inconsisten Data using Simulink

我开始使用 Simulink 并遇到以下问题:

我有一个时间向量
timeVec = [0 1 2 3 3.5 4.2 5.5 7 8];
和一个数据向量
dataVec = rand(长度(timeVec),1)*5+2;

我需要的是一个 Simulink 模型,它根据模拟时间步长对 'dataVec' 向量进行插值,从 0 到 8,间隔为 0.1。

我确实重现了文档示例(参见 https://de.mathworks.com/help/dsp/ref/interpolation.html),但我还无法解决我的问题。我至少使用了正确的块吗? Simulink 中的 Vector 'dataVec' 由常量源块给出。

感谢您的帮助!

只需使用 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,具体取决于其他要求,例如您是否需要从模型生成代码,and/or 您使用的求解器设置。