【问题标题】:How to use the output vector of a matlab function as an input for a lookup table in the same Simulink model?如何使用 matlab 函数的输出向量作为同一 Simulink 模型中查找表的输入?
【发布时间】:2016-05-06 12:09:47
【问题描述】:

我基本上使用一维数组,使用 Matlab 函数对其进行操作,输出也是一维数组。我想将其用作同一 simulink 模型中查找表的输入。此后,我希望将查找表中的这个 24 小时时间序列输出提供给另一个函数。

也欢迎任何在不使用查找表的情况下实现此时间序列输入的建议。

【问题讨论】:

    标签: matlab simulink


    【解决方案1】:

    选项 A,简单解决方案:通过工作区共享变量:

    %%
    LUT_BREAKPOINTS=<something>
    LUT_VALUES=function_that_manipulates_1D_Array()
    SIGNAL=<24_Hs_Signal>
    %%
    sim('model_name')
    %%
    <Process model output>
    %%
    

    model_name 使用FromWorkspace 加载SIGNALToWorkspace 导出模拟输出,使用一维战利品,使用 LUT_BREAKPOINTSLUT_VALUES。


    选项 B,simulink 多速率处理。

    • 将 Simulink 配置为使用离散的固定步长作为求解器。

    • 将 Direct_Look_Up_table 与 Pre_Look_Up 结合使用,将其配置为接受 表作为外部输入...

    • 用一个操作一维数组的 MatlabFunctionBlock 给它。

    • 用原始数组输入 MatlabFunctionBlock,

    • 为 Pre_Look_Up 提供 SIGNAL。

    • 在 Frame_buffer 上使用 Direct_Look_Up_table 的输出,与 以 24 小时的样本为帧。

    • 使用 Frame_buffer 的输出为另一个 MatlabFunctionBlock 提供最终处理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 2021-07-20
      • 1970-01-01
      • 2020-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多